Same words, two pages
Imagine two pages with the same words. One has tiny grey text on a light grey page, with no space between the parts. The other has clear black text, space around each part and a bold heading.
Which one do you read? Which one do you leave?
The difference is not the words. It is design technique. This lesson shows you how to use it.
Key words
| Word | What it means | Example |
|---|---|---|
| Layout grid | Invisible rows and columns that line up everything on a page. | |
| White space | Empty space around and between things. | |
| Typeface | The design of the letters. Also called a font. | Arial, Georgia |
| Letter spacing | The space between letters. | |
| Line spacing | The space between lines of text. | |
| Justification | How text lines up at the sides. | |
| Contrast | How different two colours are. | |
| Contrast ratio | A number that measures contrast. Higher is easier to read. | 4.5 to 1 |
| Input focus | The control that will get the next key press. | |
| Hover | When the mouse pointer rests on a control. |
The cells students fill in are left blank in this preview.
Techniques and the CSS that does them
| Technique | What it does | CSS |
|---|---|---|
| Layout grid | Lines things up in columns | display: grid |
| Space | Room around things | padding, margin, gap |
| Font choice | Sets the typeface | font-family |
| Letter spacing | Space between letters | letter-spacing |
| Line spacing | Space between lines | line-height |
| Justification | Lines text up | text-align |
| Colour and contrast | Text and background colours | color, background |
| Focus and hover | Show which control is active | :focus, :hover |
The cells students fill in are left blank in this preview.
A grid lines things up in columns
<div class="grid">
<div>One</div><div>Two</div><div>Three</div>
<div>Four</div><div>Five</div><div>Six</div>
</div>
Make a free account to save your work and track your progress.
Check: grids and space
Have a go
Check: grids and space
3 questionsClear type is easier to read
Choose a clear typeface. Use at most two on a page. Set body text at 16 pixels or bigger. A pixel is one tiny dot on the screen.
Give lines room: line spacing of about 1.5 times the text size helps reading. For text of 16 pixels, that is 24 pixels from one line to the next. Add a little letter spacing to small capital letters.
For justification, left aligned text is the easiest to read. Text spread to both sides makes uneven gaps.
Line spacing and alignment change reading
<h2>Match day</h2>
<p>The team meets at nine at the bus stop. Bring your kit, a water bottle and your student card. The bus leaves at ten. We play at twelve and we are back by four.</p>
Make a free account to save your work and track your progress.
Text needs enough contrast
Text must be easy to see on its background. A free contrast checker gives you a number, the contrast ratio. You do not work it out. You read it.
Body text needs a ratio of 4.5 to 1 or more. Large text needs 3 to 1 or more. Do not use colour alone to give a message. Some people cannot tell red from green.
Contrast ratios from a checker
| Text and background | Ratio | Good enough for body text? |
|---|---|---|
| Black on white | 21 to 1 | Yes |
| Dark grey (#767676) on white | About 4.5 to 1 | Yes, only just |
| Light grey (#aaaaaa) on white | About 2.3 to 1 | No |
The cells students fill in are left blank in this preview.
Check: can you read it?
Have a go
Check: can you read it?
3 questionsHover and focus show the active control
<button class="go">Book a place</button>
<input placeholder="Press Tab to come here">
Make a free account to save your work and track your progress.
Match each technique to its meaning
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
Fix a page that is hard to read
This open day page is hard to read. Fix the CSS. Follow the five TODO notes in the CSS. Make the cards a grid with a gap and padding. Use a clear font, a bigger body size and a line-height of about 1.5. Make all text dark enough. The contrast ratio must be 4.5 to 1 or more. Give the button a hover colour and a visible focus outline. Your teacher marks this task. Check your colours with a free contrast checker.
<div class="page">
<h1>College open day</h1>
<p class="intro">Come and see our computing labs. Meet the teachers. Try a coding class. Free lunch for every visitor. Saturday 14 November, from 10 in the morning.</p>
<div class="cards">
<div class="card"><h2>Computing</h2><p>Learn to code in Python and build websites.</p></div>
<div class="card"><h2>Art</h2><p>Paint, draw and make films.</p></div>
<div class="card"><h2>Sport</h2><p>Football, swimming and a new gym.</p></div>
</div>
<a href="#" class="button">Book a place</a>
</div>
Make a free account to save your work, or press Start lab to work through the whole lesson.
Key words crossword
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
Exit quiz
Have a go