$section-height:120px;
@for $num from 1 through 10{
.section-#{$num}{
height: #{$num}*$section-height;
}
}
结果是
.section-1 {
height: 1*120px; }
/ line 42, ../sass/Zigzag-layout.scss /
.section-2 {
height: 2*120px; }
/ line 42, ../sass/Zigzag-layout.scss /
.section-3 {
height: 3*120px; }
/ line 42, ../sass/Zigzag-layout.scss /
.section-4 {
height: 4*120px; }
/ line 42, ../sass/Zigzag-layout.scss /
.section-5 {
height: 5*120px; }
/ line 42, ../sass/Zigzag-layout.scss /
.section-6 {
height: 6*120px; }
/ line 42, ../sass/Zigzag-layout.scss /
.section-7 {
height: 7*120px; }
/ line 42, ../sass/Zigzag-layout.scss /
.section-8 {
height: 8*120px; }
/ line 42, ../sass/Zigzag-layout.scss /
.section-9 {
height: 9*120px; }
/ line 42, ../sass/Zigzag-layout.scss /
.section-10 {
height: 10*120px; }
运算符*被忽略了?
.section-#{$num}{
}