i have a contact webpage, in it i have a div
with some css
applied to that specific div
using its id
, i want to use this styling for more div
s which i am going to add, but only direct descendants of body
. however i have a header div
, which i use on all my pages on this site, and i dont want this styling to apply to it, or its children.
how can i use the css
:not()
selector, on the #header
div
and on its children?
CSS selector for all DIV
elements except #header
:
div:not(#header) { }
CSS selector for its children
div:not(#header) > * { }
or for all its descendants
div:not(#header) * { }
Edit
CSS selector for all DIV
elements that are body
childs except div#header
body > div:not(#header)
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