In my HTML pages I have text with img
s. The top edge of the img
is aligned with the top of the text, but I want the bottom of the img
to be aligned with the text.
How can this be done?
开发者_如何学CUPDATE Now I see this is the default behaviour, but it doesn't happen in my page. What could possibly be wrong?
EDIT: I came back to add line breaks and decided to throw an example in, too.
You can do this with CSS's vertical-align property. Something like this:
<img src="wherever.png" style="vertical-align: text-top;" />
More information about the style is available at w3schools, where they have a neat sandbox.
精彩评论