Answer the question
In order to leave comments, you need to log in
How to create a loop for nth-child?
Hello, I work in the stylus preprocessor. The task is to make the following code, through a loop, I don’t understand what’s wrong
Code in css:
.example .example__item:nth-child(1)
grid-area: item1
.example .example__item:nth-child(2)
grid-area: item2
.example .example__item:nth-child(3)
grid-area: item3
.example
for row,index in 1 2 3
.example__item:nth-child({row})
grid-area: item{row}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question