The default vertical-align
value is baseline
, it can be the bottom line of the text or the bottom line of an image (img
element is a replaced element, inline* level), which causes the offset in the first row of your demo.
In order to fix it, you can set vertical-align
to top
, or like you said set img
to display: block
also works.