Margin:auto quirk in Netscape 6+ | October 3, 2003
Thanks to Gus Campbell for spotting this issue. When centering an div using margin:auto, in Netscape 6+, if you reduce the screen width to less than the width of the div, you get a negative margin on the left hand side of the screen. This renders your site unusable for people on small monitors as it's impossible to read the text falling off the left had side of the page.
Gus did some poking around and found that setting a minimum width on the body tag would combat this problem. He also believes that, rather than being a bug, this is actually the recommended behavior.
I must admit this is a new one on me. I did a bit of googling but couldn't find this mentioned anywhere. Is this a new issue or did I just forget to read the memo?
Posted at October 3, 2003 8:29 AM
Jon Hicks said on October 3, 2003 8:55 AM
I found this problem with my site (http://exp.hicksdesign.co.uk/archives/000062.php)
It affected all gecko browsers, but then found the min-width fix on CSS Discuss, and all was well. The odd thing is, it doesn’t affect the auto margin sample on Blue Robot:
http://bluerobot.com/web/css/center1.html
Although this is a very simple layout - maybe its something to do with how elements are placed inside?