这篇文章主要介绍了css实现文字居中两边横线效果的示例代码的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
本文介绍了css实现文字居中两边横线效果的示例代码,分享给大家,具体笔记如下:
效果:
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实现文字居中两边横线效果的示例代码的详细内容,更多请关注本站其它相关文章!