Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

right align an image using CSS HTML

How can I right-align an image using CSS.

I do not want the text to wrap-around the image. I want the right aligned image to be on a line by itself.

like image 644
unixman83 Avatar asked Mar 07 '11 01:03

unixman83


People also ask

How do I align an image to the right side in HTML?

To align the image to the right use attribute value as “right”. Example: HTML.

How do I align an image to the right side of a div?

Aligning an image means to position the image at center, left and right. We can use the float property and text-align property for the alignment of images. If the image is in the div element, then we can use the text-align property for aligning the image in the div.


1 Answers

<img style="float: right;" alt="" src="http://example.com/image.png" /> <div style="clear: right">    ...text... </div>     

jsFiddle.

like image 91
alex Avatar answered Sep 21 '22 18:09

alex