Good, a doubt that I have. Is it possible, using CSS, to nest selectors?
In my project, I have several styles that I have dependent on some selectors that are common in different places, for example:
.menu1 { declaracion menu1 ... }
.menu1 .div1{ declaracion xxxx ... }
.menu1 .div2{ declaracion yyyy ... }
.menu1 .div3{ declaracion zzzz ... }
.menu2 { declaracion menu2 ... }
.menu2 .div1{ declaracion vvvv ... }
.menu2 .div3{ declaracion wwww ... }
Instead of defining them like this, is there a way to nest them so that you do not have to rewrite the first selector? Something like this:
.menu1 {
declaracion menu1 ...
.div1{ declaracion xxxx ... }
.div2{ declaracion yyyy ... }
.div3{ declaracion zzzz ... }
}
.menu2 {
declaracion menu2 ...
.div1{ declaracion vvvv ... }
.div3{ declaracion wwww ... }
}
I do not know if this is possible with CSS (I do not have SaSS or LeSS in the project). Or if there is another method more effective than doing it like I am doing it. I'm looking for documentation about it but I can not find anything and I do not know if I'm not looking good or can not do it.
Greetings and thanks