中间文字,两侧线条,文字居中的布局

 <style>
.free_fit{
position: relative;
height: 30px;
}
.tit{
width: 180px;
height: 30px;
text-align: center;
color: #616161;
font-weight: 700;
background:white;
position: absolute;
z-index: 2;
left: 50%;
margin-left: -90px;
line-height: 30px;
}
.tit-bg{
width: 100%;
height: 1px;
position: absolute;
z-index: 1;
top: 14px;
background: #ccc;
}
.zhanwei{
width: 100%;
height: 20px;
background: yellow;
text-align: center;
}
</style>

<div style="width: 100%;height: 50px;background: red">
<div class="free_fit">
<p class="tit">中间的文字</p>
<p class="tit-bg"></p>
</div>
</div>

<div class="zhanwei">
占位div,直观的验证
</div>




<style type="text/css">
ul#navlist {
font:12px verdana;
padding-bottom: 13px;
}

ul#navlist li span{
background: #FBFBFB;
}
ul#navlist li {
float: left;
height: 30px;
border: 0px solid #6c6;
width: 100%;
}
ul#navlist .list1 {
border-bottom: 1px solid #6c6;
width: 100%;
margin-bottom: -15px;
}

#navlist b {
display: block;
color: #666;
text-decoration: none;
padding: 6px 5px;
width: 100%;
text-align: center;
}
</style>

</head>

<body>

<ul id="navlist">
<li class="list1"></li>
<li class="list2"><b><span>官方精选</span></b></li>
</ul>

</body>

</html>

转载于:https://www.cnblogs.com/heyiming/p/6042308.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值