Need help? Check out our Support site, then


Centering text in a nav header?

  1. sensibilitypatterns
    Member

    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

  2. Try #nav .clearfix as your selector. And you could also try adding !important after the centering code.

Topic Closed

This topic has been closed to new replies.

About this Topic