Skip to content

Instantly share code, notes, and snippets.

@agkovalev
Last active July 7, 2020 12:27
Show Gist options
  • Save agkovalev/9491c7486e6187a373c3c547dfacfb1a to your computer and use it in GitHub Desktop.
Save agkovalev/9491c7486e6187a373c3c547dfacfb1a to your computer and use it in GitHub Desktop.
Vertical align without flexbox
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