Grouping Selectors
Sometimes you want to give the same declarations to elements that have nothing in common: they are different elements and share no class. Instead of writing two identical rules, you can group the selectors: write them one after another, separated by commas.
h2,
li {
color: purple;
}This rule makes both the h2 headings and the list items purple. You can group any selectors, for example h1, .group, #breeds, and it is customary to write each one on its own line. Don’t forget the commas: as you’ll see later in this lesson, a space without a comma means something completely different.
Instructions
- 1
Create one rule for both
h1andh2that setstext-transform: uppercase, which writes the text in capital letters.