CHAPTER 2 · 18 lessons · 234 exercises
Polish how it looks
Layered colours, spacing between letters, buttons, and what happens when you tap one. The details that make a page look the part.
In the last chapter you learned to put a page together. But looking at what you had made, you will have felt it looked somehow amateurish. This chapter is where you close that gap.
The difference between a page a professional made and the one you made is almost always in the details. Not a gift for colour or clever decoration, but the way space is left, how far apart the letters sit, how a shadow is laid on — a build-up of things nobody points out. Which also means it is a gap you can close by learning.
The first thing you take on is how to build a surface. Lay a colour on the background and put text on top of it. What starts to matter here is transparency. Let a colour through by half and it mixes with what is underneath and gains some depth. Rather than pure black text, a black let through a little has the settled look of something printed on paper.
Around text you deal with letter spacing and line spacing — how much room you leave between one letter and the next, and between one line and the next. Cramped is tight and hard to read; too open and it stops holding together. Headings especially read well pulled in a little, and body text opened up a little. They are small dials, but turn them and the impression changes plainly.
Next come headers and lists: the band across the top and the area of cards lined up, which every site has. This is the first time the question is "how do I place several elements". Line them up, get them level, keep the gaps even. Every basic worry of layout turns up here.
The second half of the chapter is the response when you touch something. The colour changes when you put the mouse over it; it sinks a little when you press. A response like that tells the person using it "this is a place you can press". It works not as decoration but as information. A button with no response at all leaves people unsure whether they may press it, so they do not.
You also learn how to make things change. A colour that switches instantly and a colour that changes slowly leave completely different impressions. Slowly here means about 0.2 seconds, which never reaches your conscious mind. It is still plenty to make something feel smooth.
One caution for building on a phone. Give anything pressable enough room. A finger is fatter than a mouse pointer, so a button that looks small is hard to press. Every screen in this course is built to that measure.
Worth learning too is how to handle shadow. A shadow makes an element look lifted, and says "this is a set apart from the rest". Laid on too heavily it looks dated, so the knack is faint, and not spreading too far. It really tells in a list of cards, where the same thing repeats.
There is a way of thinking about polish that is worth passing on. Nothing works better than lining things up. Line up the left edges, make the gaps the same, do not let the number of text sizes grow. Put unrelated values down by feel and you get a screen that looks scruffy for reasons nobody can name. The other way round, simply reusing the values you settled on will pull it together.
So it helps to decide on a few of each in advance and then choose from those for colours and space. Three steps of space — small, medium, large — and for colour, a text colour, a light text colour, a background and an accent. Stop deciding on the spot every time and the sense of one piece arrives by itself.
Looking for examples is a good method too. Open a site you thought was well made and watch how much space is left and how many text sizes there are. Anything that looks good usually has a reason. What you copy is not the palette or the trimmings, it is the reason.
Coming out the far side of this chapter, you will be able to show your pages to other people. Aim for a state where it not only works but is thought of as properly done. It is a build-up of details, so you will not get good at it all at once, but you will certainly get good at it.
Lessons in this chapter
Finish the surfaces and the text
- 28Lay the groundwork for this chapterRebuild widths, centring and spacing so you have something solid to build on.Go to the exercises
- 29A band outside, the contents insidePut a box of a set width inside a band that runs edge to edge, and stack up the frame of a page.Go to the exercises
- 30Lay a picture behind it to make a showpieceSpread a background picture across a box to make a big showpiece at the top of the page.Go to the exercises
- 31Transparency and letter spacing lift the feelSee through a colour, open up the space between letters, and settle how the page feels to the hand.Go to the exercises
- 32Round the corners into a buttonTake the underline off, puff it up with space, round the corners, and make something that looks pressable.Go to the exercises
- 33Shift things and lay them over each otherTake an element out of the flow with position, put it where you like, and lay it over something else.Go to the exercises
- 34Use the pictures provided as decorationMatch the sizes of the pictures that come with the course and put them beside text or behind a box as small decorations.Go to the exercises
Build a header and a list
- 35Send things to the left and the rightLearn float: right and split what is in the header into a group on the left and a group on the right.Go to the exercises
- 36Make the small button in a headerChange the weight of the text, wrap it in a border with rounded corners, and make the small part that goes at the right of a header.Go to the exercises
- 37Write different space for top and bottom and for the sidesLine up values, as in
padding: 8px 16px;, and set different space on different sides.Go to the exercises - 38Get the place for a list readyA band with a colour, and inside it a container of a set width. Build the base for a list out of two boxes, one inside the other.Go to the exercises
- 39Set widths as a share and line them upSet widths as a share, as in
width: 50%;, and line up cards of the same shape in equal parts.Go to the exercises - 40Clear up after the boxes you floatedStop things wrapping with
clear: both;and put the collapsed list back on its feet.Go to the exercises
React when you touch it
- 41Make a band that calls out to peoplePut one line and nothing else on a deep-coloured band, and make a place in the page where people stop.Go to the exercises
- 42Lift things with a shadowDrop a shadow under a box with
box-shadowand make depth on a flat screen.Go to the exercises - 43Change how it looks when it is touchedWrite styles with
:hoverthat only apply while the cursor is over something, and say that it can be pressed.Go to the exercises - 44Finish a footer quietlyA dividing line, smaller text, a pale colour. Build the place whose whole purpose is not to stand out.Go to the exercises
- 45Fix a header to the screenTake it out of the flow and stick it to the screen with
position: fixed;, then decide what sits in front withz-index.Go to the exercises