Created
March 24, 2017 15:01
-
-
Save dreamyguy/5da8e95651ed74128470811b469ffb31 to your computer and use it in GitHub Desktop.
Center absolutely positioned elements
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
.el-parent { | |
position: relative; | |
} | |
.el { | |
position: absolute; | |
left: 0; | |
right: 0; | |
margin: 0 auto; | |
text-align: center; | |
} | |
/* width is not necessary here :) */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment