一、Css 标题效果常见整理(二)边线框系列,边线+文字
1.
<div class="title-block"> <div class="title">新闻资讯</div> <div class="line"></div> </div>
.title-block { position: relative; background: #f9f9f9; height: 35px; line-height: 36px; padding: 0 12px 0px 16px; font-size: 15px; font-weight: bold; letter-spacing: 1px; color: #333; } .title-block .line { position: absolute; background: #0a53a3; width: 4px; height: 14px; display: inline-block; border-radius: 2px; left: 5px; top: 50%; transform: translate(0,-50%); }
显示效果:
2.
<div class="title-block"> <div class="title">科技</div> </div>
.title-block { border-bottom: 1px solid #C9DFF4; } .title-block .title { position: relative; top: 1px; color: #1479d7; border-bottom: 4px solid #0276DA; color: #404040; font-size: 20px; height: 39px; line-height: 39px; display: inline-block; letter-spacing: 2px; }
显示效果:
3.
<div class="title-block"> <div class="title">千乐微云</div> </div>
.title-block{ position: relative; border-bottom:1px solid #ddd; padding: 10px 0px; } .title-block .title{ font-size: 20px; letter-spacing: 2px; height: 23px; line-height: 20px; text-indent: 10px; border-left: 5px solid #408ed6; }
显示效果:
更多: