4
.style1 * { vertical-align: middle; } 

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

3 Answers 3

4

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

Sign up to request clarification or add additional context in comments.

Comments

3

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".

Comments

1

As the other said, it's the universal selector, selecting all descendant elements under .style1. To demonstrate:

Given this HTML:

<div class="style1"> <p>foo</p> <div>bar</div> </div> 

And this CSS:

.style1 { border: 1px solid; } /* styles applied to the .style1 element */ --------------- | foo | | | | bar | --------------- .style1 * { border: 1px solid; } /* styles applied to descendants of .style1 */ --------------- | foo | +-------------+ | bar | --------------- 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.