Grouping Selectors

Sometimes we need to apply the same style to multiple elements that have nothing in common. They are not the same element, don't have the same class, and don't share a common attribute. In such cases, grouping selectors come in handy. We can achieve this by separating the elements with a comma. For example:

.group,
p {
	color: purple;
}

This code selects both elements with the class group and p elements and sets their color to purple (color: purple).

Instructions

Create a rule for both h1 and h2 elements with the following declaration: text-transform: uppercase.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

9/12

Grouping Selectors | Start Coder