On Fri, Jul 15, 2011 at 5:34 AM, Steve Caramia [EMAIL-REMOVED]> wrote:
> This one's reeeally easy, but ALWAYS hangs me up. This time I'll
tape the
> answer to my forehead so I don't forget!
>
> Why doesn't margin: 0 auto center the nav bar here? text align:
center
> doesn't work either.
>
> http://www.theeyecam.com/eyecam2/index.htm
>
> the css: http://theeyecam.com/eyecam2/SpryAssets/SpryMenuBarHorizontal.css
Since its (default) display is "block", it takes up the full width of
the containing element. "margin: 0 auto" would center it, if it was
smaller than the <nav> that contains it.
To make it the same size as its contents, either add up the widths of
the elements it contains (560px) and set a fixed width, or set its
display value to "inline-block".
In other words, both Micky Hulse and David Laakso were right, but they
told you how to fix it. I wanted to answer you question about why it
wasn't centered.
--
Ghodmode
http://www.ghodmode.com/blog
Perfect! Thanks for the explanation Ghodmode!!
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/