firefox center (Full Version)

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



Message


Brandon -> firefox center (7/28/2006 22:15:52)

Centering problem in firefox. I think I'm losing my mind! [:@] I don't have that much code, but I can't seem to see what I did to cause this centering problem.

Webpage
<body>
<div id="container">
<div id="header"><img src="images/logo.gif" alt="Lawson Design Studio" width="450" height="150" /></div>
<div id="top">
</div>
<div id="main">
  </div>
<div id="bottom"></div>
</div>
</body>


CSS
body {margin: 0 auto; padding: 0; text-align: center; line-height: 1.5em; color: #000;  background:#4b4a49 url('images/bg.jpg') repeat-x;}

#container {margin: 0 auto; text-align: center;  width: 760px; height: 650px;  }

#header {width: 450px; height: 150px; padding: 0; margin-top: 40px;}

#top {width: 450px; height: 50px; margin-top: 10px; padding: 0; background:url(images/content_top.gif) no-repeat;}

#main {width: 450px; height: 300px; padding: 0; background:url(images/main.gif) repeat-y;}

#bottom {width: 450px; height: 145px; padding: 0; background:url(images/content_bottom.gif) no-repeat; }




Tailslide -> RE: firefox center (7/29/2006 3:17:31)

Hi Brandon

Not sure exactly what you're trying to do... were you wanting to centre the header and main divs etc on the page? If so, then you could always make the container box 450px wide (or maybe 452px) and then the internal divs will be centralised as the container div is.

Or you could use margin:0 auto on the individual divs within the container.

Unless there's something else going in the container it's probably easier to make it narrower to "fit" the inside divs - then the lot will be centralised.




Brandon -> RE: firefox center (7/31/2006 10:10:22)

Thanks Tailslide... [:)] "make the container box 450px wide" Fixed it




Page: [1]

Valid CSS!




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