Skip to content

Instantly share code, notes, and snippets.

@ShivKumarSaini
Last active April 9, 2018 11: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 ShivKumarSaini/fa64050825eb94a684f3152eb5a41c88 to your computer and use it in GitHub Desktop.
Save ShivKumarSaini/fa64050825eb94a684f3152eb5a41c88 to your computer and use it in GitHub Desktop.
Vertical allignment of text using CSS3
/**
Please have a look at this link:
>> https://stackoverflow.com/questions/79461/vertical-alignment-of-elements-in-a-div/45458436#45458436
*/
.immediate-parent-of-text-containing-div{
height: 50px; /* or any fixed height that suits you.*/
}
.text-containing-div {
display: inline-grid;
align-items: center;
text-align: center;
height: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment