0
What does the * element in CSS mean?
What is the * element in CSS? What are the features and how to use them?
3 Answers
+ 5
* is the wildcard symbol in CSS. It will match everything. It can be useful for CSS reset files.
For example: * { color: white; background-color: black } would set every element to be in dark mode. * { box-sizing: border-box } would set the sizing rule for all elements to border-box (something I use in my CSS reset files)
+ 2
Wondering if the * element helps format every element in CSS?
+ 2
Nguyá»
n Viá»
n yes, the wildcard * will format all elements. An element followed by the wildcard will match all descendants of the matched element.
"*" Matches all elements.
"<selector> *" would match all descendants of "<selector>"
Example: "article *" would select all descendants of article tags.