Possible Duplicate:
css: the meaning of * mark
What does *
do in css? I saw some code here that contained it:
.center-wrapper{
text-align: center;
}
.center-wrapper * {
margin: 0 auto;
}
Is this a typo?
A CSS selector is the first part of a CSS Rule. It is a pattern of elements and other terms that tell the browser which HTML elements should be selected to have the CSS property values inside the rule applied to them.
The CSS Universal Selector The universal selector (*) selects all HTML elements on the page.
Basic selectors Example: * will match all the elements of the document. Selects all elements that have the given node name. Example: input will match any <input> element. Selects all elements that have the given class attribute.
* means all elements. For example: div *{ background-color:red; }
In this case .center-wrapper *
everything under every element with center-wrapper class.
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