Answer the question
In order to leave comments, you need to log in
Is it legal to use :nth-child() in BEM?
I have 4 .clients__client elements in my .clients block. They differ from each other only in the background image. Is it possible to set this picture via :nth-child(1-4)? Or does each need to be given a modifier? Or even put these pictures in img inside these elements? You can do it either way, but how would it be correct from the point of view of BEM?
Answer the question
In order to leave comments, you need to log in
From a BEM point of view, it would be correct to make modifiers.
.clients__client--client1
.clients__client--client2
.clients__client--client3
.clients__client--client4
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question