CSS伪元素after、before使用示例(四)

  使用:before、:after伪元素,添加分割线。不用增加DOM元素,只需在对应元素上添加样式即可。

/*元素前、后画线的处理*/
.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>

猜你喜欢

转载自wallimn.iteye.com/blog/2366355
今日推荐