<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Document</title> <style> .title{ width:200px; height:50px; line-height:50px; text-align:center; position:relative; } .title::after, .title::before{ position: absolute; width:30px; height:3px; background:#000; content:''; top:25px; } .title::after{ left:0; } .title::before{ right:0; } </style> </head> <body> <div class="title"> 这里标题内容 </div> </body> </html>
用css伪类实现文字左右两边有横线的效果
最新推荐文章于 2022-04-22 15:18:17 发布