Why do you need the floats? Just at a glance, I'd suspect that that's what's
messing up your centering.
Rick Gordon
------------------
On 7/30/10 at 1:16 PM +0200, Peter Lawson wrote in a message entitled
"[css-d] Simple menu bar":
>I doubt you get questions more basic than this :-[
>
>How do I get this menu bar to centre itself on the page?
>And show its background colour?
>
><style type="text/css">
>#nav {
> margin: 0 auto 3em auto; float: left; padding: 0;
> list-style: none;
> background-color: #f2f2f2;
> border-bottom: 2px solid #ccc; border-top: 2px solid #ccc; }
>#nav li { float: left; }
>#nav li a {
> display: block;
> padding: 8px 9px;
> text-decoration: none;
> font-weight: bold;
> color: #069;
> border-right: 2px solid #ccc; }
>#nav li a:hover {
> color: #c00;
> background-color: #fff; }
>.bl { border-left: 2px solid #ccc; }
> </style>
></head>
><body>
><ul id="nav">
> <li class="bl"><a href="index.html">Home</a></li>
> <li><a href="History.html">History and Structure</a></li>
> <li><a href="Groups.html">Groups</a></li>
> <li><a href="Constitutions.html">Constitutions</a></li>
> <li><a href="Concessions.html">Concessions</a></li>
> <li><a href="Opportunities.html">Opportunities</a></li>
> <li><a href="Magazines.html">Magazines</a></li>
> <li><a href="Links.html">Links</a></li>
></ul>
--
___________________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________
WWW: http://www.shelterpub.com
______________________________________________________________________
css-discuss [[email protected]]
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/