Hi, i would like to center a container, and it works fine in FF. But when i look at my site in IE the container is on the left side of the screen. could someone please have a look and give me a hint? thanks in advance!
I don't open zips but do you have a valid doctype with no spaces or text or anything before it? If you are using margin: 0 auto on this container and FF shows it centered, but IE not, I'm guessing something is throwing IE into Quirks mode because when it's in "standards" mode (or what IE calls "standards"), that centering should also work. Never works for IE5.5 and below. If you care about them, the trick is body { text-align: center; } Which is only supposed to center inlines but in old IEs it also centers blocks. If this works in IE6 then it's definitely in Quirks mode! Get it out of there! next container or wrapper { text-align: left; } if you really don't want the text centered on the whole page.
i have to use <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:\//www.w3.org/TR/html4/loose.dtd"> because of some javascript in the page, else it wont pass the validator. have a look here please : html: http://pastie.caboo.se/private/xq0qekbxwjnuvbmcuc1eg css: http://pastie.caboo.se/private/rr28n6fa9tfdjmh85nfjkg
Still waiting for the page to load but Transistional is fine. The point is, when the page is being looked at by the browser (when you click View Source), is there anything, even a space, before the doctype? IE sees something other than <!D... as the first thing and goes immediatly into Quirks Mode (even though there's a doctype).
the very first character of the page is "<". have a look at the attachments please, but rename the mycss.css.html to .css first.
Okay, hah! This one's easy. You have a typo. You have: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:\//www.w3.org/TR/html4/loose.dtd"> See that slash after http:? You need: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Done : ) Tested: http://stommepoes.nl/testtt.html (I'm only going to keep that site on my server for a while, long enough for you to see the effects... my background is sitting in the middle of the page : )