效果:解决边框1px的问题
把对应的class名写到需要添加边框的元素上。按需添加。
/*边框1px*/
.border-1px{
position: relative;
}
.border-1px:after{
display: block;
width:100%;
position: absolute;
top: 0;
left: 0;
right:0;
bottom:0;
border-top:1px solid #000;
content:" ";
}
/*边框向下1px*/
.border-bottom-1px{
position: relative;
}
.border-bottom-1px:after{
display: block;
width:100%;
position: absolute;
left: 0;
bottom:0;
border-top:1px solid #000;
content:" ";
}
/*边框向上1px*/
.border-top-1px{
position: relative;
}
.border-top-1px:after{
display: block;
width:100%;
position: absolute;
left: 0;
top:0;
border-top:1px solid #000;
content:" ";
}