6
How to apply a CSS setup only when a tag is with the classes nome1 and Nome2 at the same time?
I tried with the following code, but it’s not working. Does anyone know how to do?
.nome1 {
color: black;
}
.nome2 {
color: blue;
}
.nome3 {
color: green;
}
.nome1 .nome2 {
color: red;
font-size: 18pt;
}
<div class="nome1">
Nome1
</div>
<div class="nome2">
Nome2
</div>
<div class="nome3">
Nome3
</div>
<div class="nome1 nome2">
Nome1 e Nome2
</div>
According to the criteria of W3schools.com you are almost right, If you added to the two 2 different colors, so it gave conflict, see this link: https://www.w3schools.com/cssref/tryit.?filename=trycss_sel_class_more2
– Lauriano Elmiro Duarte