Kra*_*mir 10
这应该做的伎俩:
$colors: (#000, #F00, #0F0, #00F);
@for $i from 1 through length($colors) {
li:nth-of-type(#{$i}) {
background: nth($colors, $i);
}
}
Run Code Online (Sandbox Code Playgroud)
它产生:
li:nth-of-type(1) {
background: black; }
li:nth-of-type(2) {
background: red; }
li:nth-of-type(3) {
background: lime; }
li:nth-of-type(4) {
background: blue; }
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6521 次 |
| 最近记录: |