首页 > Web开发 > 详细

CSS实现:标题两侧画线效果

时间:2018-10-26 19:08:26      阅读:228      评论:0      收藏:0      [点我收藏+]

如图:

技术分享图片

html代码:

1 <div class="detail-news">
2         <h5 class="detail-news-title">
3             <span>详细信息</span>
4         </h5>
5 </div>

css代码:

 1 .detail-news-title{
 2     font-size: 16px;
 3     font-weight: normal;
 4     text-align: center;
 5     padding-top: 10px;
 6     position: relative;
 7 }
 8 .detail-news-title::before{
 9     content: "";
10     display: block;
11     width: 60vw;
12     height: 1px;
13     background: #333;
14     position: absolute;
15     left: 50%;
16     margin-left: -30vw;
17     top: 18px;
18 }
19 .detail-news-title span{
20     padding: 0 10px;
21     background: #fff;
22     position: relative;
23     z-index: 2;
24 }

 

CSS实现:标题两侧画线效果

原文:https://www.cnblogs.com/yangguoe/p/9857938.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!