Hello, I would like to know how to align the image inside the div on the right side?
Thank you.
Hello, I would like to know how to align the image inside the div on the right side?
Thank you.
You can give the surrounding div
a
text-align: right
this will leave white space to the left of the image. (= the image will occupy the whole line).
If you want content to be shown to the left hand side of the image, use
float: right
on the image. However, the surrounding div
will then need overflow: auto
to stretch to the needed height.
<div style="width:300px; text-align:right;">
<img src="someimgage.gif">
</div>