[thelist] center works in IE but not in Netscape/Moz
robin at rhastings.net
robin at rhastings.net
Thu Jan 15 14:44:47 CST 2004
Quoting Scott Blanchard <octigonuser at hotmail.com>:
>
> http://demo.octigon.com/websites/templates/studentlife/test.htm
>
> This site design should be centered in the browser window ( body
> {text-align:center} )
>
> But I cannot get it to center in any browser other than IE. Any help would
> be much appreciated!
>
> Here's the css...
>
>
> body {text-align:center; background:#fff;
[snipped]
> #main {position:relative; text-align:left; width:777px; height:auto;
> background:#fff url(../images/sidebarBottom.gif) no-repeat bottom right}
> #content {min-height:250px; background:transparent; width:auto;
> padding:15px; margin-right:158px;}
If I'm not mistaken, IE's implementation of the text-align: center rule is
wrong. It should just align text in a box, not the whole box. You may want to
try adding right and left margins set to auto to the div that needs to be
centered. Adding margin-right: auto; margin-left: auto; to your main ID might
just do the trick.
Robin
robin at rhastings.net
More information about the thelist
mailing list