The css vertical-align issue
11 Aug 2017 | iker hurtado
One issue that comes up from time to time when I'm laying out a web design is controlling the height of text or images inside an inline box. In this post I want to set a simple way to achieve it.
The height of the base of elements (text or images) inside inline boxes is controlled by the css property: vertical-align.
I haven't test it out deeply but I think the effect of some values (text-top, middle, etc) aren't so intuitive as it might seem. On the other hand the kind of value that's worked always for me is the percentage one. So for now, until I understand the rest of the value kinds, I'll use this option:
vertical-align: 20%;