.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;
}
<ul>
<li id="shouye" class="active1"><a class="shu-right">店铺首页</a></li>
<li><a οnclick="location.href='page.html'" class="shu-right">全部商品</a></li>
<li id="zhendian"><a>镇店之宝</a></li>
</ul>
</div>
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;
}
<ul>
<li id="shouye" class="active1"><a class="shu-right">店铺首页</a></li>
<li><a οnclick="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>