Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

User interface techniques

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

50 minutes

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 the techniques of design. You will learn them and use them.

Key words

WordWhat it meansExample
Layout gridInvisible rows and columns that line up everything on a page.
White spaceEmpty space around and between things. It is not wasted.
TypefaceThe design of the letters. Also called a font.Arial, Georgia
Letter spacingThe space between letters.
Line spacingThe space between lines of text.
JustificationHow text lines up at the sides: left, right, centre or both sides.
ContrastHow different two colours are, such as text and background.
Contrast ratioA number from a checking tool. A higher number is easier to read.4.5 to 1
Input focusThe control that will get the next key press.
HoverWhen 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

TechniqueWhat it doesCSS
Layout gridLines things up in columnsdisplay: grid
SpaceRoom around thingspadding, margin, gap
Font choiceSets the typefacefont-family
Letter spacingSpace between lettersletter-spacing
Line spacingSpace between linesline-height
JustificationLines text uptext-align
Colour and contrastText and background colourscolor, background
Focus and hoverShow which control is active:focus, :hover

The cells students fill in are left blank in this preview.

Try it: a layout grid

Code: web
<div class="grid">
  <div>One</div><div>Two</div><div>Three</div>
  <div>Four</div><div>Five</div><div>Six</div>
</div>

Quick check: grids and space

Have a go

Quick check: grids and space

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Type: choose and set it

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.

Try it: set the type

Code: web
<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>

Colour and 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.

The rule: 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 backgroundRatioGood enough for body text?
Black on white21 to 1Yes
Dark grey (#767676) on whiteAbout 4.5 to 1Yes, only just
Light grey (#aaaaaa) on whiteAbout 2.3 to 1No

The cells students fill in are left blank in this preview.

The lesson goes on

6 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.