Depends on the version of IE and the doctype. IE 6 in standards mode (full
valid doctype of HTML 4.01 Strict or XHTML) will use margin-auto but in any
event unless your content is constrained by a container inside div#container
it will expand to fill the space so there will be no margins. 

Personally I don't bother with the first part. People using earlier browsers
can get it left aligned so I go with the simpler code:

#container {width: 740px; margin: 0 auto;}


Cheryl D. Wise
Certified Professional Web Developer
MS-MVP-FrontPage
www.wiserways.com
mailto: [EMAIL PROTECTED]
713.353.0139 Office

-----Original Message-----
From: Howard Cheng

"text-align: center" is really only supposed to apply to text and it works
in IE only because IE doesn't interpret it properly.

The CORRECT way to do it is:

body {
        text-align: center;
} /* for IE */
div#container {
        margin: 0 auto;
        text-align: left;
} /* for standards-compliant browsers */

<html>
<body>
<div id="container">

</div>
</body>
</html>

The "margin" setting means 0 for top and bottom, and auto margins for left
and right, which throws the div into the center.


____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set 
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to