Posted By

egan10 on 04/29/11


Tagged

div css center


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

wirenaught


dead center a div - short version


 / Published in: CSS
 

225 is half the height, 350 is half the width

  1. #deadCenter {
  2. width: 700px;
  3. height: 450px;
  4.  
  5. margin: -225px 0 0 -350px; /* 225 is half the height, 350 is half the width */
  6. position: absolute;
  7. top: 50%;
  8. left: 50%;
  9. }

Report this snippet  

You need to login to post a comment.