We Recommend

CSS: The Definitive Guide CSS: The Definitive Guide
Provides you with a comprehensive guide to CSS implementation, along with a thorough review of all aspects of CSS 2.1. Updated to cover Internet Explorer 7, Microsoft's vastly improved browser, this new edition includes content on positioning, text wrapping (nowrap), lists and generated content, table layout, user interface, paged media, and more.


Posted By

danideu on 10/23/06


Tagged

CENTRADO


Versions (?)


Who likes this?

5 people have marked this snippet as a favorite

postNuKe
Hirmine
DrStrangelove
tavo
vali29


DIV CENTRADO HORIZONTAL Y VERTICALMENTE


Published in: CSS 


URL: http://www.nudonation.com/archivos/css/

  1. #mydiv {
  2. position:absolute;
  3. top: 50%;
  4. left: 50%;
  5. width:30em;
  6. height:18em;
  7. margin-top: -9em; /*set to a negative number 1/2 of your height*/
  8. margin-left: -15em; /*set to a negative number 1/2 of your width*/
  9. border: 1px solid #ccc;
  10. background-color: #f3f3f3; }

Report this snippet 

You need to login to post a comment.