简体   繁体   中英

why wont my top navigation and columns center?

http://min.us/mvoed0E

that's a link to my html and css file. i don't know why my margins aren't centering things. also, i don't know why the text is expanding past the container.

you were trying to align the container even though it was in a different element

so first i added this to your nav

<li class="active">
<li><a class="floatr" href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Story</a></li>
<li><a href="#">Order</a></li>
</ul>

and got rid of the <div class="floatr"></div>

then i changed the css slightly

.lavalamp ul li a {
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 5px;
    padding-bottom: 5px;
    text-align: center;
    color: #fff;
    font-size: 18px;
    font-family: 'Merriweather', Helvetica, Arial, sans-serif;
    }

.floatr {
    top: 10px;
    z-index: 50;
    width: 80px;
    height: 30px;
    border-radius : 8px;
    -moz-border-radius : 8px;


       -webkit-border-radius : 8px;
        background : rgba(0,0,0,.20);
        -web

kit-transition: all .4s ease-in-out;
    -moz-transition: all .4s ease-in-out;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM