Friday 23 June 2017

Float an image to the Left or Right of Text using CSS ~ GNIITHELP

Float an Image to Left : (use any one)
1. Add a style attribute to the image, and apply the float property:
<img src="image-sample.jpg" alt="image-caption" style="float:left;" />
2. You can add some margins to the image to increase its readability:
<img src="image-sample.jpg" alt="image-caption" style="float:left;margin:0 5px 0 0;" />

3. With CSS float, an element can be pushed to the left, allowing other elements to wrap around it.
img {
    float: left;


Float an Image to Right : (use any one)
1. Add a style attribute to the image, and apply the float property:
<img src="image-sample.jpg" alt="image-caption" style="float:right;" />
2. You can add some margins to the image to increase its readability:
<img src="image-sample.jpg" alt="image-caption" style="float:right;margin:0 5px 0 0;" />

3. With CSS float, an element can be pushed to the right, allowing other elements to wrap around it. 
img {
    float: right;
}

    No comments:

    Post a Comment