sass cycle

 

@for $i from 1 through 5 {
  li {
    &:nth-child(#{$i}) {
      .bgImg {
        background-image: url(../images/index/index-icon#{$i}.png);

      }
    }
  }
}

Guess you like

Origin www.cnblogs.com/lucy1111/p/11126798.html