css怎么实现文字居中两边横线效果
发布时间:2021-03-19 09:50:44
来源:亿速云
阅读:92
作者:小新
这篇文章将为大家详细讲解有关css怎么实现文字居中两边横线效果,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
效果:
html>
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
Document.title{
text-align: center;
position: relative;
height: 50px;
line-height: 50px;
width: 800px;
margin: 200px auto;
}
.title:after,.title:before{
content: "";
position: absolute;
top: 50%;
background: #7a7a7a;
height: 1px;
width: 35%;
}
.title:after{
left: 0;
}
.title:before{
right: 0;
}
css实现文字居中两边横线效果
关于“css怎么实现文字居中两边横线效果”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。