Reputation: 6412
I am familiar with the asterisk used as a wild card in CSS.
My question is: Is there a CSS selector for absolutely ALL (I mean html, body, along with every single descendant, direct or otherwise) elements of a page?
I have tried:
*
{
color: green; /*Used this just to test and see if it worked, but didn't*/
}
Is this possible in CSS?
Please don't ask why I want to do this, LOL :)
Upvotes: 0
Views: 595
Reputation: 1256
The *
universal selector does select every element, including the root <html>
element and all of its descendants.
You can also combine them like * *
which would select the child of the root element ( <body>
) and all of its descendants and * * *
to style the next generation and all of its descendants.
Or you can style only the grandchildren and below of a div: div * * {color: lemonchiffon;}
Upvotes: 5