Created
September 6, 2015 20:05
-
-
Save alnorris/cec9ff1d7cc60dd8d8e7 to your computer and use it in GitHub Desktop.
Center middle a Div
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
/* | |
When changing the width and height, change the margin to a negative half sized value, and line height | |
/* | |
#centermiddle { | |
margin: -100px 0 0 -100px; | |
display: block; | |
border:1px solid red; | |
width: 200px ; | |
height: 200px; | |
position: fixed; | |
left: 50%; | |
top: 50%; | |
line-height: 200px; | |
text-align: center | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment