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.
To align the image to the right use attribute value as “right”. Example: HTML.
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.
<img style="float: right;" alt="" src="http://example.com/image.png" /> <div style="clear: right"> ...text... </div>
jsFiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With