April 16, 2015

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

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;
}

0 comments:

Disclaimer

We shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its response or damage to your system. We do not guarantee that the integrity or security of this communication has been maintained or that this communication is free of viruses, interceptions or interferences. Anyone communicating with us by email accepts the risks involved and their consequences. We accept no liability for any damage caused by any virus transmitted by this site.