Growing with the Web

Centering text vertically using CSS


This is the easiest and best way to center text vertically, simply set the line-height to the same value as height. Remember that in order to modify the height of an element, it needs to be displayed as either a block or inline-block.

Like this article?
Subscribe for more!