Centering text in a nav header?
-
I’ve searched through the FAQs and can’t find anything on how to center text inside a nav header. My blog is at http://sensibilitypatterns.wordpress.com. You’ll see that the page links are not centered but left justified. Here’s what I have in my custom CSS code:
#nav {
background:#3C4280;
border:5px solid #3C4280;
border-top:none;
font-size:1.2em;
float:center;
text-align:center;
margin-bottom:5px;
width:750px;
margin-top:-60px;
padding:0;
}#nav ul {
list-style-type:none;
}#nav ul li {
font-weight:bold;
float:center;
letter-spacing:-.5px;
text-align:center;
margin-bottom:-3px;
margin-right:10px;
padding:2px 5px;
}#nav ul li a {
text-align:center;
color:#fff;
font-family:Times, Tahoma, Verdana, Arial, Helvetica, sans-serif;I tried adding “center” codes all over the place, as you can see (new to CSS–learning on the fly!). What am I doing wrong, or is it just not possible to center the page links?
Thanks!
Jennie
-
Try
#nav .clearfixas your selector. And you could also try adding !important after the centering code.
- The topic ‘Centering text in a nav header?’ is closed to new replies.