Fun with IE (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets and Accessibility



Message


derbz -> Fun with IE (8/7/2006 3:11:47)

Is there an alternative to 'margin: 0 auto;' it seems that IE does not honor it. FireFox centers fine ie6 does screwy things with text-align too.

I'm having trouble finding an answer. Please help [:@]
xweb




Tailslide -> RE: Fun with IE (8/7/2006 3:24:09)

Yeah no problem.

Firstly, if you add in a proper DOCTYPE then IE6 will honour the margin:0 auto; thing. Without a proper DOCTYPE IE6 reverts to non-standards mode and as you've found out ignores it.

The other thing you can do (either with a DOCYTPE to catch IE5 and IE5.5 or without a DOCTYPE to work on IE6 too) is to add text-align:center to the body element which will centre the whole page in IE. Then you normalise the text by adding in text-align:left usually to a containing div lower down in the order so it's like this:

body {text-align:center; (all your other rules here too)} 
#container {margin:0 auto; text-align:left;}






jaybee -> RE: Fun with IE (8/7/2006 6:31:05)

Go with the Doctype. IE7 is just around the corner.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
4.736328E-02