Introduction:

In this article we are going to learn what is float property in css or how to use float property in css or how to align html element left or right using float property in css with example.

 

Description:

 

CSS float property is used to set the position of html elements. Its place the html element left or right side of it container, allowing text and inline elements to wrap around it.

 

Let’s see, Example of CSS float property:

 

 <!DOCTYPE html>
<html>
<head>
    <style>
        img {
            float: right;
        }
    </style>
</head>
<body>
    <p>
        The following paragraph contains an image with style
        <b>float:right</b>. The result is that the image will float to the right in the paragraph.
    </p>
    <p>
    <img src="https://www.themessageninja.com/images/Industries/SoftwareDeveloper.jpg" width="300" alt="Software Developer" />
    he is a Software Developer. he is a Software Developer. he is a Software Developer.
    he is a Software Developer. he is a Software Developer. he is a Software Developer.
    he is a Software Developer. he is a Software Developer. he is a Software Developer.
    he is a Software Developer. he is a Software Developer. he is a Software Developer.
    he is a Software Developer. he is a Software Developer. he is a Software Developer.
    he is a Software Developer. he is a Software Developer. he is a Software Developer.
    he is a Software Developer. he is a Software Developer. he is a Software Developer.
    he is a Software Developer. he is a Software Developer. he is a Software Developer.
    he is a Software Developer. he is a Software Developer. he is a Software Developer.
    he is a Software Developer. he is a Software Developer. he is a Software Developer.   
    </p>
</body>
</html>


 Let's check live example

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like