Last active
April 9, 2018 11:44
-
-
Save ShivKumarSaini/fa64050825eb94a684f3152eb5a41c88 to your computer and use it in GitHub Desktop.
Vertical allignment of text using CSS3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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