<div>
<p class="str">xxxx</p>
<p class="str">xxxx</p>
<p class="str">xxxx</p>
<p class="str">xxxx</p>
<span>222</span>
</div>
想要改变最后一个str元素样式 因为后面还有span 所以用last-child不生效 用 last-of-typ
.actionmargin:not(:last-of-type){ //简写 其他都有margin-bottom: 18px; 最后一个不会生效
margin-bottom: 18px;
// &:last-of-type{
// margin-bottom: 0;
// }
}
.actionmargin{
margin-bottom: 18px;
&:last-of-type{
margin-bottom: 0;
}
}