순환 css의 가장 간단한 방법: scss를 통해 n번째 하위 위조 클래스를 순환합니다
779 단어 scsscssstylesheetloop
$count: 1;
@while $count < 10+1{
.classname:nth-of-type(#{$count}){
width: auto;
}
$count: $count+1
}
이 출력은 다음과 같습니다.
.classname:nth-of-type(1) {
width: auto;
}
.classname:nth-of-type(2) {
width: auto;
}
.classname:nth-of-type(3) {
width: auto;
}
.classname:nth-of-type(4) {
width: auto;
}
.classname:nth-of-type(5) {
width: auto;
}
.classname:nth-of-type(6) {
width: auto;
}
.classname:nth-of-type(7) {
width: auto;
}
.classname:nth-of-type(8) {
width: auto;
}
.classname:nth-of-type(9) {
width: auto;
}
.classname:nth-of-type(10) {
width: auto;
}
고맙습니다.
Reference
이 문제에 관하여(순환 css의 가장 간단한 방법: scss를 통해 n번째 하위 위조 클래스를 순환합니다), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/nikhilroy2/easiest-way-to-loop-the-css-nth-child-pseudo-class-by-scss-3hjp텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)