css · level 1 · unit 3 · lesson 1
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
font-size makes text bigger or smaller.
The style of the letters is called the . font-size sets how big the letters are. The value is a number with a after it, like 24px, with no space between them.
px is short for , one of the tiny dots of light that make up your screen. Ordinary text is 16px. An <h1> starts at 32px, which is why headings look big.
Make the important things big and the small print small. Around 12px is the smallest most people can read in comfort.
<h1>Big news</h1>
<p>The cat learned to open the fridge.</p> h1 {
font-size: 48px;
}
p {
font-size: 20px;
} Press show my page to see it here.
Try 100px on the heading to see how far it goes.
guess first
Which one ends up bigger?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
<h1>Tiny title</h1>
<p>Huge words</p> h1 {
font-size: 12px;
}
p {
font-size: 40px;
}
your turn
Your turn. Make the headline shout.
Set the heading's size to anything from 40px to 80px. Remember: a number, then px, with no space between them.
the page you’re styling
<h1>Goal!</h1>
<p>Sam scores in the very last minute.</p>your css
Press show my page to see it here.
- the heading is 40px to 80pxnot checked yet
fix it
The paragraph will not grow. Can you fix it?
the page you’re styling
<h1>Lost cat</h1>
<p>Answers to the name of Pickles.</p>your css
Press show my page to see it here.
- the paragraph is 20pxnot checked yet
- The size did not change. Look closely at the value.
- A number and its unit must touch, with nothing between them.
- Change
20 pxto20px, then press run.
nailed it
you made words bigger and smaller. :D
font-sizesets how big the letters are.pxmeans pixels. Ordinary text is16px.- Write the number and the unit together, like
24px.
new words in your collection
- font
- unit
- pixel
This lesson isn’t saved. A free account remembers every lesson you finish.