HTML & CSS: How I can make an image's bottom edge align with text?
Question
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?
UPDATE Now I see this is the default behaviour, but it doesn't happen in my page. What could possibly be wrong?
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow