The vertical-align property is one of those features of CSS that sounds pretty self-explanatory, but can cause problems for CSS beginners. It works only on inline or inline-block elements and table cells and when not used on a table cell, it will affect the alignment of the element itself, not the element’s contents.
The common misconception about vertical-align is that, when it’s applied to an element, it will make all the elements inside that element change their vertical position. For example, when using vertical-align: top on an element, it’s assumed that the contents of that element get pushed up to the top of the element.
Comments
Be the first to write a comment
You must me logged in to write a comment.