移动端自适应横排导航条

.daohang{
width: 100%;
text-align: center;
background-color: white;
height: 40px;
line-height: 38px;
}
.daohang ul{
display: table;
margin: auto;
width: 100%;
list-style-type: none;
}
.daohang ul li{
display: inline-block;
width: 33%;
text-align: center;
font-size: 15px;
}
.daohang ul li a{
display: inline-block;
width: 100%;
height: 25px;
line-height: 20px;
}
.shu-right{
border-right: 1px solid #CCCCCC;
}

.active1{
border-bottom:2px solid #43AFEA ;
color: #43AFEA;
}

<div class="daohang">
 <ul>
    <li id="shouye" class="active1"><a class="shu-right">店铺首页</a></li>
    <li><a onclick="location.href='page.html'" class="shu-right">全部商品</a></li>
    <li id="zhendian"><a>镇店之宝</a></li>
 </ul>
</div>

<script type="text/javascript">
$(document).ready(function(){
$(".daohang ul li").click(function(){
$(this).addClass("active1").siblings().removeClass("active1");
});
})
</script>

猜你喜欢

转载自blog.csdn.net/qq_40001322/article/details/81015783
今日推荐