jessyhoule

CSS / Center Div

Jun 25th, 2015
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.36 KB | None | 0 0
  1. #idOfTheDiv {
  2.    width: 400px; /* here you put the width that you need */
  3.    height: 200px; /* here you put the height that you need */
  4.    position:absolute;
  5.    left:50%;
  6.    top:50%;
  7.    margin-left:-200px; /* this number always to be the width divided two in negative */
  8.    margin-top:-100px; /* this number always to be the height divided two in negative */
  9. }
Advertisement
Add Comment
Please, Sign In to add comment