• Hello,

    I would like to center my DIV menu but I’m having some trouble.

    I’ve tried adding text-align:center; in a few places, and once I take away “float:left;” from the CSS #nav li, the text centers right down the page. I want to the menu to stay on one line centered on the page.

    Here’s my CSS:

    #nav {
    width:auto;
    padding:12px 0 0;
    }
    #nav ul {
    height:50px;
    text-align:center;
    }
    #nav li {
    float:left;
    display:inline;
    width:auto;
    }
    #nav li a {
    font-size:13px;
    font-weight:400;
    display:block;
    padding:15px;
    border-bottom:none;
    }

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you tried to remove display:block; from #nav li a and float:left; from #nav li?

    Thread Starter aca529

    (@aca529)

    Okay, now I’m using a different theme.

    How would I go about centering the menu items in the DIV “tabs”?

    Thanks.

    Here’s the CSS:

    #tabs{
    padding: 0;
    background:black;
    }
    
    #tabs ul{
    margin: 0;
    padding:3px 0;
    list-style-type:none;
    
    }
    
    #tabs ul li{
    display:inline;
    margin: 10px 0 3px 15px;
    padding: 6px 15px 6px 0px;
    border-right: 2px solid #fff;
    font-size: 90%;
    font-family: Tahoma, Arial, sans-serif;
    }
    
    #tabs ul li a{
    color: white;
    }
    
    #tabs ul li a:hover{
    color:#A1E7FD;
     text-decoration:none;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Centering the DIV menu’ is closed to new replies.