Font Size
The font-size property sets the size of the text. You already know pixels:
h1 {
font-size: 40px;
}For text, however, we usually use another unit: rem. 1rem is the browser's base font size, normally 16 pixels. So 2rem is 32 pixels and 0.5rem is 8 pixels (decimal numbers with a dot, as always in CSS).
Why not just pixels? People who don't see well often set a larger base font size in their browser settings. Sizes in rem grow with it, so the whole page stays readable and keeps its proportions. Sizes in pixels stay the same, whatever the visitor has set.
Ordinary text is 16 pixels (1rem) by default, and browsers make headings bigger: an h1 heading is 32 pixels and an h2 heading 24 pixels.
Instructions
- 1
In the rule for
#title, addfont-size: 3rem(48 pixels). - 2
In the rule for
h2, addfont-size: 1.75rem(28 pixels).