Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Selector: What does the asterisk mean in the following 2 lines

Tags:

css

.style1  * {
   vertical-align: middle;
}

..If I take it out, things with this style are no longer vertically aligned.

like image 806
Chad Avatar asked Feb 28 '23 11:02

Chad


2 Answers

* is the wildcard selector, it's selecting anything within/under an element with the style1 class on it.

like image 98
Nick Craver Avatar answered May 01 '23 14:05

Nick Craver


It's the Universal Selector, and will match any element. The selector you have written will match any element which is a descendant of an element with the class "style1".

like image 28
Zack The Human Avatar answered May 01 '23 14:05

Zack The Human