Created
February 18, 2016 15:21
-
-
Save floster/419d2d206f097cef840f to your computer and use it in GitHub Desktop.
Vertical align with :after
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
.outer { | |
width: 200px; | |
height: 500px; | |
text-align: center; | |
background-color: #ffc; | |
} | |
.outer:after { | |
display: inline-block; | |
height: 100%; | |
vertical-align: middle; | |
content: ""; | |
} | |
.inner { | |
display: inline-block; | |
width: 100px; | |
vertical-align: middle; | |
background-color: #fcc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment