Centre using Negative Margins


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. body {margin:0px; padding:0px;}
  2.  
  3. #Content {
  4. position:absolute;
  5. left:50%;
  6. width:500px;
  7. margin-top:50px;
  8. margin-left:-266px;
  9. padding:15px;
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.