CSS vertical-align Playground

Mrs. Yanti’s price board with Mr. Karim’s strings on each line: set vertical-align on an icon, a photo or a button in your line of text, and the browser’s…

Why it matters

This property is misused more than any: reached for to centre blocks (it never works) and behind the "mysterious gap under an <img>". Once you see the line’s lines it uses, and that middle is not the line’s middle, hours of debugging are over.

The key idea

vertical-align aligns to the line’s lines, not to its container

Common mistakes

Try it in this playground