Good morning Mike,
I must respectfully disagree. I'm looking at my client site in FF, Opera,
Mozilla and Netscape as I compose this reply, and the page is left-aligned
using "margin:0 auto" in the body rule only.
However, it center-aligns the page when placing the "margin:0 auto" in a
container div.
body
{text-align: center;
background: #ccc;}
#container
{margin: 0 auto;
width: 760px;
font: normal 12px verdana, arial, sans-serif;
background: #fff;}
Respectfully yours,
Mario
> Hi Mario,
>
> That only occurs with IE v5.
> IE v5.5, v6, Firefox, Netscape and Opera will all centre the design. The
> only amend required to get IE v5 to behave is to add text-align:center
> to the body element. Then compensate for that alignment in the elements
> below:
>
> * {margin:0; padding:0}
> html {height:100%; font-size:100.01%}
> body {
> text-align:center;
> min-height:101%;
> font:76.1%/130% Verdana, Helvetica, sans-serif;
> color:#000; background:#fff;
> width:760px;
> margin:0 auto
> }
>
> body * {text-align:left}
> #wrapper {width:760px}
>
> (Amended from:
> http://www.websemantics.co.uk/tutorials/useful_css_snippets/#leveller)
>
> IE v5 requires all the centred content to be in a wrapper div (other
> browsers don't).
>
> <div id="wrapper">all centred content in here</div>
>
>
> mike 2k:)2
>
> <marquee><blink>
> e-mail: [EMAIL PROTECTED]
> site: http://www.webSemantics.co.uk
> </marquee></blink>
>
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Sent: 20 June 2005 19:32
> To: [email protected]
> Cc: Mike Foskett
> Subject: RE: [WSG] Class Discusion: Centering a Fixed Width Layout
>
> Hi Mike,
>
> Great set of CSS code snippets and explanations! However, there is one
> declaration that suggests using "margin: 0 auto" in the body rule, which
> supposedly center-aligns the webpage in the browser. However, testing
> reveals that it left-aligns the page, but placing this declaration in a
> container or wrapper works.
>
> Please advise...
>
> Respectfully yours,
> Mario
>
>
>> You might find this useful to look at:
>> http://www.websemantics.co.uk/tutorials/useful_css_snippets/#leveller
>> Gives light detail on why certain settings are used.
>>
>> The latest version:
>> http://www.websemantics.co.uk/tutorials/useful_css_snippets/#levelleru
>> pdate It requires text-align:center adding for IE v5 though.
>>
>> Hope it helps
>>
>> mike 2k:)2
>>
>> <marquee><blink>
>> e-mail: [EMAIL PROTECTED]
>> site: http://www.webSemantics.co.uk </marquee></blink>
>>
>>
>>
>> **********************************************************************
>> This email and any files transmitted with it are confidential and
>> intended solely for the use of the individual or entity to whom they
>> are addressed. If you have received this email in error please notify
>> the system manager.
>>
>> This footnote also confirms that this email message has been swept by
>> MIMEsweeper for the presence of computer viruses.
>>
>> www.clearswift.com
>> **********************************************************************
>>
>>
>> ******************************************************
>> The discussion list for http://webstandardsgroup.org/
>>
>> See http://webstandardsgroup.org/mail/guidelines.cfm
>> for some hints on posting to the list & getting help
>> ******************************************************
>
>
>
> ******************************************************
> The discussion list for http://webstandardsgroup.org/
>
> See http://webstandardsgroup.org/mail/guidelines.cfm
> for some hints on posting to the list & getting help
> ******************************************************
>
>
>
>
>
> ******************************************************
> The discussion list for http://webstandardsgroup.org/
>
> See http://webstandardsgroup.org/mail/guidelines.cfm
> for some hints on posting to the list & getting help
> ******************************************************
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************