Tuesday, January 13, 2009

Center align site layout using CSS


Recently I began creating 100% CSS layouts, and faced a lot of problems in getting the content to be centered in both IE and FF. After lot of googling, the final working css is :




body {
text-align:center;
}

div#content{
text-align:left;
width:748px;
margin:0 auto;
}




Change "content" for the name of the enclosing div around the page content.



 

No comments:

Post a Comment