/*元素前、后画线的处理*/ .hra,.hrb{ position:relative; } .hra:after,.hrb:before{ content:""; position:absolute; bottom:0; height:1px; background-color:gray; left:0; right:0; } .hrb:before{ top:0; bottom:auto; }
使用示例:
<div class="hra">留言列表</div>
/*元素前、后画线的处理*/ .hra,.hrb{ position:relative; } .hra:after,.hrb:before{ content:""; position:absolute; bottom:0; height:1px; background-color:gray; left:0; right:0; } .hrb:before{ top:0; bottom:auto; }
<div class="hra">留言列表</div>