Full-Stack course / Tools and the web
A type scale in relative units
How to fetch and submit this exercise
Once: install the tool and connect your account.
curl -fsSL https://gonomicon.com/install.sh | sh
gonomicon loginEach exercise: download it, edit the file named in the instructions, then submit.
gonomicon fetch fs-week-1/05-03-docs-type-scale
cd 05-03-docs-type-scale
gonomicon submitA type scale in relative units
Build a documentation page whose paragraph and heading sizes follow a fixed relative scale, with different colors for body text and its link.
Worked example: At a 16px root size, a paragraph computes to 16px, an h2 to 32px, and an h1 to 48px; the link has a different computed color from the body text.
Rules and constraints
- Edit
index.htmlandstyles.css; no JavaScript is needed. - Keep one h1, one h2, and two paragraphs inside
<main id="doc">. - Link
styles.cssfrom the HTML document. - Use relative font sizes and set the root font-size baseline.
- Set body text and link colors with hex or hsl values; their computed RGB colors must be distinct.
What you'll practice
- Linking an external stylesheet.
- Using
remto create a consistent type scale. - Checking computed font sizes and colors in the browser.
Run it
gonomicon fetch fs-week-1/05-03-docs-type-scale
cd 05-03-docs-type-scale
gonomicon test
gonomicon submit
Hints
- Compare each text size with the root size, not with its nearest parent.
- Use the paragraph as the base and keep the heading sizes at fixed multiples of it.
- At a 16px root, the paragraph, h2, and h1 sizes are 1rem, 2rem, and 3rem.