Results 1 to 2 of 2

Thread: Quick centering layout question

  1. #1
    Join Date
    Jan 2007

    Quick centering layout question

    Hey everyone,

    I have a quick question that I thought might be more efficient to just post then to Google...

    I'm reading a CSS book, and in an example the author shows how to bypass the traditional "container" div to center the layout. His solution: text align: center the html selector, and set body selector margin to: 0 auto, and set a 770 width. I get the body rule, im just uncertain why i have to text align center the html selector?? It seems redundant to me, but it could be my newbie-ness. To me, the browser results look the same with or without this rule applied. Any thoughts? Thanks!

    --- example ---

    html {
    text-align: center;

    body {
    width: 770px;
    margin: 0 auto;
    text-align: left;

  2. #2
    Join Date
    May 2005
    Gold Coast (MS)
    One is for IE and related engine driven browsers. The other for all the other good browsers. :P

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center