Skip to content

Instantly share code, notes, and snippets.

@alnorris
Created September 6, 2015 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alnorris/cec9ff1d7cc60dd8d8e7 to your computer and use it in GitHub Desktop.
Save alnorris/cec9ff1d7cc60dd8d8e7 to your computer and use it in GitHub Desktop.
Center middle a Div
/*
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