日期:2014-05-18  浏览次数:20471 次

问一个简单的问题啊,我的li为什么不能横向排列,在线等!!
我的css如下,我页面的里怎么还是纵向排列的呢?
CSS code

#templatemo_menu {
    clear: both;
    width: 940px;
    height: 51px;
    padding: 0 10px;
    background: url(images/tempatemo_menu.png) no-repeat;
}

#templatemo_menu ul {
    margin: 0;
    padding: 14px 12px 0;
    list-style: none;
}

#templatemo_menu ul li {
    padding: 0;
    margin: 0;
    display: inline-block;
}

#templatemo_menu ul li a {
    float: left;
    display: block;
    font-size: 13px;
    width: 100px;
    height: 25px;
    padding: 5px 0 0 0;
    color: #afdeff;    
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    outline: none;
}



HTML code

<div id="templatemo_menu">
            <ul>
                <li><a href="index.html" class="current">Home</a></li>
                <li><a href="services.html">Services</a></li>
                <li><a href="partners.html">Partners</a></li>
                <li><a href="about.html">About us</a></li>
                <li><a href="contact.html">Contact</a></li>
            </ul>        
        </div> <!-- end of templatemo_menu -->



------解决方案--------------------
去掉float:left试试
------解决方案--------------------
探讨
我的css如下,我页面的里怎么还是纵向排列的呢?
CSS code

#templatemo_menu {
clear: both;
width: 940px;
height: 51px;
padding: 0 10px;
background: url(images/tempatemo_menu.png) no-repeat;
}

#template……

------解决方案--------------------
#templatemo_menu ul li {
padding: 0;
margin: 0;
display: inline-block;
float:left;
width:100px;
}

------解决方案--------------------
代码没有错啊,ie8下显示横排