Skip to content

Instantly share code, notes, and snippets.

@UVLabs
Last active March 26, 2017 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UVLabs/596905cf4e84769c2f1d to your computer and use it in GitHub Desktop.
Save UVLabs/596905cf4e84769c2f1d to your computer and use it in GitHub Desktop.
Verical align text in any element. Make parent element display: table, then make item display: table-cell and vertical-align: middle
#instructor .num {
display: table;
font-size: 20px;
font-weight: bold;
color: white;
line-height: 24px;
height: 240px;
width: 240px;
text-align: center;
background: #dd5638;
}
#instructor .num .num-content{
display: table-cell;
vertical-align: middle;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment