例子:
.feature-list .item:not(:last-child):after {
content: "";
position: absolute; /* 绝对定位是哪个li的,li哪里用相对定位*/
right: 0;
top: 10px;
width: 1px;
height: 100px;
background: #ff6d01;
}
注释:
1.selector:after( sRules ) 它要和content属性一起使用,设置在对象前(依据对象树的逻辑结构)发生的内容;
2.:not(:last-child) 去除所有与给定选择器匹配的元素,就算去除最后一个匹配的选择器元素。
3.content代表插入内容。content为空时,插入的内容默认是一个行内元素