About

Breaking

Tuesday 23 May 2017

CSS float align - set div left, right or center

CSS float property set the elements align to a left side or right side.
CSS Text formatting chapter we learn CSS text-align property set text align left, right or center. Same as float property element or group of element align set either left side or right side.


CSS फ्लोट प्रॉपर्टी सेट करें तत्वों को एक बाएं ओर या दाएं तरफ संरेखित करें।
सीएसएस पाठ स्वरूपण अध्याय हम सीखते हैं कि सीएसएस टेक्स्ट-संरेखित संपत्ति सेट टेक्स्ट बाएं, दाएं या केंद्र को संरेखित करें। फ्लोट प्रॉपर्टी एलिमेंट या तत्व का समूह समान बाएं ओर या दायां ओर सेट करें


Example Code:

 

<body>
    <div style="width:250px;float:right;background-color:orange;">
        <p>This example is content the elements align in left or right side you can set. the paragraph font size is 12 pixel.</p>
    <div>
</body>

 

Example Result:

 

 

Example Code:

<body>
    <div style="width:250px;float:left;background-color:orange;">
        <p>This example is content the elements align in left or right side you can set. the paragraph font size is 12 pixel.</p>

    <div>
</body>

 

 

Example Result:

 

Set Float div center

You can set float div center by using margin property. you does not need to use float property but you can use margin property and set left or right margin value auto by this way,

फ्लोट डिवेल सेंटर सेट करें
 
आप मार्जिन संपत्ति का उपयोग करके फ्लोट डिवेल सेंटर सेट कर सकते हैं। आपको फ्लोट प्रॉपर्टी का उपयोग करने की आवश्यकता नहीं है लेकिन आप मार्जिन प्रॉपर्टी का उपयोग कर सकते हैं और इस तरह से बाएं या दाएं हाशिया मान ऑटो सेट कर सकते हैं,

Example Code:


<body>
    <div style="width:250px;background-color:orange;margin:0px auto;">
        <p>This example is content the elements align in center you can set. the paragraph font size is 12 pixel.</p>
    <div>
</body>

Example Result:


No comments:

Post a Comment