Centering something that floats left

Discussion in 'Water Cooler' started by The Cadet, Jun 10, 2009.

  1. The Cadet

    The Cadet Adept

    135
    4
    104
    $title - Your site for great afro-carribean music!

    I need that button row to be centered. However, for them to be the way they are, they require the float:left tag.

    HTML:
    li
    {	margin: 0;
    padding: 0;
    list-style: none;
    float: left;
    font: 16px charcoal,impact;}
    
    HTML:
        <li><a href="shop.php">Shop</a></li>
    <li><a href="termine.php">Termine</a> </li>
    <li><a href="contakt.php">Contakt</a> </li>
    <li><a href="info.php">Bandinfo</a> </li>
    <li><a href="kritik.php">Kritikien</a> </li>
    
    How can I get that centered?
     
  2. Peggy

    Peggy Regular Member

    1,641
    58
    434
    Have you tried the <div align="center"> </div> tags?
     
  3. The Cadet

    The Cadet Adept

    135
    4
    104
    Yep. Didn't work. Tried centering it in the CSS, tried centering it with <center>, nothing seems to work. >.< Basically, I need either a way to give it float:none and still stay on one line, or a way to center it through float left. :(
     
  4. Lynne

    Lynne Regular Member

    333
    32
    164
    You want to get rid of the float:left and instead have display:inline for all your <li> elements in that id.
     
  5. The Cadet

    The Cadet Adept

    135
    4
    104
    Just saved that as such. It produces an ugly blob. Look again if you want to see it. It doesn't work. It may have something to do with the fact that the "display:block" tag is a necessity for "li a" and the sole contents of the lists are links.
     
  6. Lynne

    Lynne Regular Member

    333
    32
    164
    You need to do it for all your <li> tags in that id. You didn't change it in this one:
    Code:
    #sddm li a
    {    [COLOR=Red]display: block;[/COLOR]
    margin: 0 1px 0 0;
    padding: 4px 10px;
    background: #a8503c;
    color: #ebcfaa;
    text-align: center;
    text-decoration: none;}
     
  7. The Cadet

    The Cadet Adept

    135
    4
    104
    That's for links. And I can't do that because that [****][****][****][****]s up the javascript drop-down menus.
     
  8. Wayne Luke

    Wayne Luke Regular Member

    991
    276
    202
    .buttons {
    float: left;
    text-align:center;
    width: 100%
    }


    Then try using display: inline-block on your LI tags. You should not be floating your list (LI) elements.
     

Share This Page