Andreas Eracleous

Align text vertically center in div with CSS

To stay updated when a new content for devs is out, sign up!

In this example I will show you on how you can align text vertically in the middle with div tag. There are few ways to align a text vertically in the center using CSS code.

Ways to align text vertically center

Below are the properties that can use to vertical align a text in the middle of a div tag.

  • line-height
  • transform
  • display

See the Pen Align text vertically center by Andreas Eracleous ( @Sp00ky ) on CodePen .