Any difference between ' :root ' and ' * ' ? Please I need an explanation for each :) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Any difference between ' :root ' and ' * ' ? Please I need an explanation for each :)

:root{color: red;} *{color: red;}

3rd Feb 2019, 11:50 PM
Nael Sharabi
Nael Sharabi - avatar
1 Answer
+ 3
:root is the root of the HTML document. Not the html tag but higher than that. Sort of like the document itself. * is the universal selector. It selects all elements, including :root.
4th Feb 2019, 5:02 AM
Rowsej
Rowsej - avatar