Last active
July 7, 2020 12:27
-
-
Save agkovalev/9491c7486e6187a373c3c547dfacfb1a to your computer and use it in GitHub Desktop.
Vertical align without flexbox
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
html, body { height: 100%; } | |
.container { | |
position: relative; | |
text-align: center; | |
display: block; | |
height: 100%; | |
&::before, | |
.box { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
&::before { | |
content: ''; | |
width: 0; | |
height: 100%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment