.JTBabs.active:before {
content: '';
position: absolute;
left: 20px;
bottom: 0px;
right: 20px;
border-top: 3px solid red;
}
把要加的下边框的那个元素设置为相对定位
position:relative;
本文介绍如何使用CSS为元素添加红色实线下边框,通过设置特定样式属性实现。关键在于利用:before伪元素结合绝对定位,同时需将目标元素设为相对定位。
.JTBabs.active:before {
content: '';
position: absolute;
left: 20px;
bottom: 0px;
right: 20px;
border-top: 3px solid red;
}
把要加的下边框的那个元素设置为相对定位
position:relative;
962
532
1229

被折叠的 条评论
为什么被折叠?