HighDots Forums  

margin: auto

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss margin: auto in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeff
 
Posts: n/a

Default margin: auto - 02-22-2008 , 02:50 PM






Updating my bag of tricks again.

What's the level of support for margin: auto. Is this widely
supported now amongst almost all browsers?

It's a common request to have a "centered" page. I don't remember
which major browser didn't support margin: auto, but there was a common
hack with some "text-aligns". Is it time to drop the hack?

Jeff

Reply With Quote
  #2  
Old   
Rik Wasmus
 
Posts: n/a

Default Re: margin: auto - 02-22-2008 , 03:08 PM






On Fri, 22 Feb 2008 21:50:42 +0100, Jeff <jeff (AT) spam_me_not (DOT) com> wrote:

Quote:
Updating my bag of tricks again.

What's the level of support for margin: auto. Is this widely
supported now amongst almost all browsers?
Save MSIE6 and lower.

Quote:
It's a common request to have a "centered" page. I don't remember
which major browser didn't support margin: auto, but there was a common
hack with some "text-aligns". Is it time to drop the hack?
Nope, MSIE6 still needs it. margin:auto on the element for any other
browser, text-align:center on the parent element for MSIE6.
--
Rik Wasmus


Reply With Quote
  #3  
Old   
dorayme
 
Posts: n/a

Default Re: margin: auto - 02-22-2008 , 03:18 PM



In article <13rudd4o354c1a2 (AT) corp (DOT) supernews.com>,
Jeff <jeff (AT) spam_me_not (DOT) com> wrote:

Quote:
Updating my bag of tricks again.

What's the level of support for margin: auto. Is this widely
supported now amongst almost all browsers?

It's a common request to have a "centered" page. I don't remember
which major browser didn't support margin: auto, but there was a common
hack with some "text-aligns". Is it time to drop the hack?
IE 6 is the one to worry about. It will not centre a block with
margin: auto and a width.

--
dorayme


Reply With Quote
  #4  
Old   
Bergamot
 
Posts: n/a

Default Re: margin: auto - 02-22-2008 , 04:41 PM



Rik Wasmus wrote:
Quote:
On Fri, 22 Feb 2008 21:50:42 +0100, Jeff <jeff (AT) spam_me_not (DOT) com> wrote:

It's a common request to have a "centered" page. I don't remember
which major browser didn't support margin: auto, but there was a common
hack with some "text-aligns". Is it time to drop the hack?

Nope, MSIE6 still needs it.
Nope, IE6 does *not* need it, at least not in standards mode.
Margin:auto works perfectly fine. IE5.x doesn't grok it, but who cares?

You shouldn't be coding for quirks mode any more anyway.

--
Berg


Reply With Quote
  #5  
Old   
Bergamot
 
Posts: n/a

Default Re: margin: auto - 02-22-2008 , 04:43 PM



dorayme wrote:
Quote:
In article <13rudd4o354c1a2 (AT) corp (DOT) supernews.com>,
Jeff <jeff (AT) spam_me_not (DOT) com> wrote:

What's the level of support for margin: auto. Is this widely
supported now amongst almost all browsers?

IE 6 is the one to worry about. It will not centre a block with
margin: auto and a width.
bollocks

I use margin:auto all the time. It works perfectly fine in IE6.

--
Berg


Reply With Quote
  #6  
Old   
Rik Wasmus
 
Posts: n/a

Default Re: margin: auto - 02-22-2008 , 04:58 PM



On Fri, 22 Feb 2008 23:41:21 +0100, Bergamot <bergamot (AT) visi (DOT) com> wrote:

Quote:
Rik Wasmus wrote:
On Fri, 22 Feb 2008 21:50:42 +0100, Jeff <jeff (AT) spam_me_not (DOT) com> wrote:

It's a common request to have a "centered" page. I don't remember
which major browser didn't support margin: auto, but there was a common
hack with some "text-aligns". Is it time to drop the hack?

Nope, MSIE6 still needs it.

Nope, IE6 does *not* need it, at least not in standards mode.
Ah, most of my pages are valid strict 4.01, did seem to run into troubles
a time ago, maybe I used a lousy doctype back then...

Quote:
Margin:auto works perfectly fine. IE5.x doesn't grok it, but who cares?
You shouldn't be coding for quirks mode any more anyway.
Amen.
--
Rik Wasmus


Reply With Quote
  #7  
Old   
dorayme
 
Posts: n/a

Default Re: margin: auto - 02-22-2008 , 07:35 PM



In article <6291gtF21882rU2 (AT) mid (DOT) individual.net>,
Bergamot <bergamot (AT) visi (DOT) com> wrote:

Quote:
dorayme wrote:
In article <13rudd4o354c1a2 (AT) corp (DOT) supernews.com>,
Jeff <jeff (AT) spam_me_not (DOT) com> wrote:

What's the level of support for margin: auto. Is this widely
supported now amongst almost all browsers?

IE 6 is the one to worry about. It will not centre a block with
margin: auto and a width under some circumstances.

bollocks

I use margin:auto all the time. It works perfectly fine in IE6.
Perhaps you missed the words "under some circumstances" <g>

--
dorayme


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.