Created
May 18, 2016 21:21
-
-
Save legomolina/00e624b1512ff3931791f1470d29fc7c to your computer and use it in GitHub Desktop.
Center horizontally and vertically fixed div with only css
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
#my-div { | |
position: fixed; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
margin: auto; | |
width: 80vh; /* Whatever you want*/ | |
height: 20vh; /* Whatever you want*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment