Interactive online courses HTML Academy
2026-03-09 10:59 Diff

You definitely made an impression on the boss. Just look at his tail twitch! Already some new requirements have arrived.

I want to make the headings stand out somehow. Maybe you could emphasize them or play with the margins…

It would seem that there is a simple solution to the problem: let’s find a CSS rule for subheadings and add the desired properties to it. But no such rules have been written, so you will have to create them from scratch. This is where selectors are needed, so it would be good to learn more about them.

A selector specifies which tags receive properties from the CSS rule. Tag selectors work the easiest: they select all of the tags with a matching name. For example:

p { color: red; }

In the example, the selector is p, and it selects all tags with the name p (that is, the <p> tags), but it won’t select tags with other names, such as h1.

On our website subheadings are indicated by using the h2 tags, and we need to format everything that uses these tags. The tag selector is perfect for this, because it will select all of them.

Here is our plan: You create a new, empty CSS rule for subheadings:

name_of_desired_tag { }

Our designer has already chosen the properties and the values, so now you need to add them to your CSS rule.