for循环和if配合使用 @for $i from 1 to 12 { @if $i%2==0{ .detail-info:nth-child(#{$i}) { border: 1px solid blue; font-size: 18px; width: 200px; } } }