Why is the element green? [duplicate]

The second p isn’t :not(.classy) so it isn’t color: red. This means it still has its default colour, which is color: inherit.

The body element is :not(p) so it is color: green.

The second p therefore inherits the green colour from the body element.

The developer tools in your browser would have told you this:

Developer tools showing CSS rules applied to the second paragraph as described above

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)