I was wondering if it is possible to align a picture using the align=middle style in CSS, not html.
<img alt="" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Smiley.png/50px-Smiley.png" align="middle" />Text!
Try this,
img{
vertical-align:middle;
}
Use css property vertical-align:middle;
you are using align
attribute that in CSS is float : left;
or float : right;
middle won't do anything, you only have option left or right.
For vertical-align, answers have already been given.
to center a single image on a line , you can use on parent : text-align:center;
, image is an inline-box that reacts like text.
You can as well set image in display : block;
and margin : auto;
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