I have a div like : <div class='class'>
I notice that div.class handles this style, while .class div does not. Moreover, .class handles the style as well.
Why is that ?
I notice that
div.classhandles this style, while.class div doesnot.
div.class looks for a div with the class class present.
.class div looks for a div that is a descendent of an element with the class class.
Your element is a div with the class class, hence the selector does not select it.
Moreover,
.classhandles the style as well.
.class will select any element with that class, including any div elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With