Last active
December 16, 2015 19:50
-
-
Save achudars/5488062 to your computer and use it in GitHub Desktop.
Perfectly centered FLEXBOX using CSS with a 10% margin.
Perfectly centred FLEXBOX using CSS with a 10% margin.
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
body { | |
position: absolute; | |
background-color: #333333; | |
bottom:0; | |
top:0; | |
right:0; | |
left: 0; | |
} | |
#blueDiv { | |
position:absolute; | |
bottom:10%; | |
top:10%; | |
right:10%; | |
left: 10%; | |
background-color: #333333; | |
display: -webkit-box; | |
-webkit-box-align: center; | |
-webkit-box-pack: center; | |
display: -moz-box; | |
-moz-box-align: center; | |
-moz-box-pack: center; | |
display: -ms-flexbox; | |
-ms-flex-align: center; | |
-ms-flex-pack: center; | |
display: box; | |
box-align: center; | |
box-pack: center; | |
background-color: #3399FF; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment