On 12/8/11 7:12 PM, Michael Beaudoin wrote:
Hey all,

I've got a simple one that is stumping me.

I have a horizontal navigation that I want centered in a div
(top_nav that contains it. I have tried to use the top_nav div to try
and center the top_nav li but it won't budge. What am I missing?

[code stripped]

Floated list items are difficult to center. Try this:

/* text-align aligns the entire menu */
#top_nav {
  text-align: center;
}

#top_nav ul {
  margin: 0;
  padding: 0;
}

/* make horizontal; get rid of bullets */
#top_nav li {
  display: inline;
}

/* allow top and bottom padding, even in old IE */
#top_nav a, #top_nav a:visited {
  display: inline-block;
/* add background, color, padding... to taste */
}

HTH.
--
Cordially,
David
______________________________________________________________________
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/

Reply via email to