Erik Harris wrote:
> Okay, sorry to send three messages for the same page...  I
> thought I had solved my problem by double-div'ing, but now I
> can't seem to get the container div to center horizontally.
> Could someone glance at this page and let me know how I can
> center the menu (horizontally) in the browser window? It
> seems to place it in an apparently-random place, just left of
> center in Firefox, and way the heck over to the right in IE.

A div takes the full available width, unless you set the width, 
or the margins.
You set the margins to auto, so the width of the div is as wide 
as it wants to be.
Give it a width, and it will center. (I reckon a width of 655px 
would be suitable ;-) )

To a question in your other mail:
Yes, a div with position:relative *is* a containing block, there 
is no need to have two nested divs for that.

General advice: if you find stuff like this not doing what you 
want, add *{border:1px solid red;} to your stylesheet 
(temporarily of course), so you can see the borders of the 
elements. You would instantly have seen the width of 
#MainContainer :-)

On your page, you can take off the #MainContainer, and in the 
stylesheet, take off the styles for it too, and change the 
"position: absolute; top: 0; left: 0;" on #MainMenu to "position: 
relative; margin-left: auto; margin-right: auto;".

BTW, if you have an option of hosting examples like this 
somewhere else, it would be good. I now had to wait for a blocked 
popup, and then wait very long (on a 3MB DSL line) for each image 
to load.

-- 
Els
http://locusmeus.com/
http://locusoptimus.com/

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to