Sub topic 2
Deciding what matters most: ranking your content
This chapter assumes you can write semantic HTML, you know basic CSS (selectors, the box model, units), and you can open your browser's developer tools. Layout code comes in later chapters. Here you decide what goes on the page, and in what order, before you write any CSS.
Why ranking comes first
A small screen shows very little at once. A typical phone in portrait shows a column about 360 to 430 CSS pixels wide, and the visitor sees one screenful at a time. If you put everything on the page at equal weight, the visitor has to scroll past material they did not come for.
Ranking your content means putting each piece in order of how much the visitor needs it. On a desktop layout you can hide a weak ranking behind sidebars and columns, because everything is visible at once. On a phone, the order is the design. The first thing in the column is what the visitor sees first.
Mobile-first design uses this limit on purpose. If you can decide what belongs at the top of a 360px-wide column, you have made the hard decisions. Larger screens then get the same content with more room, not a different page.
A ranking method you can repeat
You can rank content in four steps.
- List the visitors and their tasks. Name the two or three reasons people come to the page. For a small business site, these might be "find opening hours", "call or get directions" and "see the menu".
- Inventory the content. List every block the page might hold: headings, paragraphs, images, forms, links, banners, widgets.
- Score each block. Rate how much each block helps the main tasks.
- Sort and cut. Order the blocks by score. Move low-scoring blocks to the end, behind a control, or off the page.
A simple scale works well:
| Rank | Meaning | Example on a restaurant page |
|---|---|---|
| Must | Without it, the visitor cannot finish their main task | Opening hours, phone number, address |
| Should | Helps most visitors but is not blocking | Menu, photos of the dining room |
| Could | Useful to some visitors | Press quotes, the story of the owners |
| Won't (here) | Does not support a task on this page | A newsletter pop-up, a social media feed |
The scale forces a decision. If everything is "Must", you have not ranked anything.
Worked example: a restaurant home page
Suppose you start with this inventory, in the order the owner first mentioned it:
- Large banner image with a slogan
- Story of the restaurant
- Latest press quotes
- Full menu
- Opening hours and address
- Reservation button
- Photo gallery
- Newsletter sign-up
Research or analytics usually shows that most mobile visitors want to check the hours, find the address or book a table. Ranked by those tasks, the order changes:
- Name and one-line description
- Reservation button and phone link
- Opening hours and address
- Menu
- Photo gallery
- Story of the restaurant
- Press quotes
- Newsletter sign-up
The banner image dropped out of the top spots. It is attractive, but it does not help anyone book a table, and on a phone it can push all the useful content below the first screen.
Turning the ranking into markup
The ranked list becomes the source order of your HTML. Source order is the order elements appear in the HTML file. A single column simply follows it from top to bottom, so no CSS is needed to get the right order on a phone.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Casa Verde Restaurant</title>
</head>
<body>
<header>
<h1>Casa Verde</h1>
<p>Family-run Italian kitchen in the old town.</p>
<p>
<a href="/book">Reserve a table</a>
<a href="tel:+15550100">Call us</a>
</p>
</header>
<main>
<section aria-labelledby="visit">
<h2 id="visit">Visit us</h2>
<p>12 Mill Lane, Oldtown</p>
<p>Tue to Sun, 12:00 to 22:00</p>
</section>
<section aria-labelledby="menu">
<h2 id="menu">Menu</h2>
<p>Seasonal pasta, wood-fired pizza and house desserts.</p>
</section>
<section aria-labelledby="story">
<h2 id="story">Our story</h2>
<p>We opened in 1998 and cook from one family recipe book.</p>
</section>
</main>
</body>
</html>The viewport meta tag is already in the head. The next chapter explains what it does. For now, notice that the body has the ranked content in the right order and no layout rules at all.
Content types and what they cost
Different kinds of content take very different amounts of vertical space on a phone. Weigh the cost when you score a block.
- Text is cheap to scroll and easy to scan if you use short paragraphs and clear headings.
- Images can fill an entire screen. Ask what task the image supports. A product photo supports a purchase. A decorative banner usually does not.
- Forms are expensive. Each field needs a label, an input and spacing, and the on-screen keyboard covers about half the screen while the visitor types. Keep only the fields you need.
- Tables with many columns do not fit in a narrow column. Consider whether the data can be a list of short entries.
- Embedded widgets (maps, videos, social feeds) are heavy in both space and download size. Link to them or load them on demand.
Order is not the same as importance in every situation
Ranking depends on context, so check these cases before you commit.
Different pages have different top tasks
Your home page, a product page and a contact page serve different visitors. Rank each page on its own. A rule such as "the phone number goes first" is wrong on a page whose job is to explain a product.
Returning visitors differ from new ones
A first-time visitor may need to know what you do. A returning visitor wants to log in or check an order. If analytics show both groups, give the primary task of the larger group the top spot, and keep the other task reachable with one tap, for example through a clearly visible link in the header.
Content the visitor expects in a fixed place
Some elements have habitual positions: the site name at the top, the main navigation near the top, legal links in the footer. Ranking does not mean breaking these habits. Rank the content inside the page, and leave the site-wide structure where people expect it. Navigation patterns get a full chapter later.
Source order affects more than sight
Screen readers and keyboard users move through the page in source order. Because you built the ranking into the HTML, these users benefit from it too. This is a reason not to rearrange the order later with CSS properties such as order or grid-area unless you have a good reason. The visual order and the reading order then disagree, which confuses people who navigate with a keyboard.
Common mistakes
- Ranking by what the organisation wants to say. A mission statement may matter to the team, but visitors rarely arrive for it. Rank by visitor tasks.
- Starting from the desktop design and removing things. This tends to produce a page that is a crowded desktop page squeezed into a column. Start from the ranked list and add.
- Hiding "Must" content. Putting key content behind a menu or a collapsed section costs the visitor an extra tap on the thing they came for. Collapse only "Could" content.
- Treating "Won't" as "later". If a block does not support a task, ask whether the page needs it at all. Moving it to the bottom still makes the visitor download it.
- Ranking once and never revisiting. Real behaviour often surprises you. Check your assumptions with data, as the testing chapter describes.
Ranking as a flow
The diagram shows the process as a loop, because ranking should be checked against real use.
Making the ranking visible in code
A ranking you keep only in your head tends to drift. One lightweight habit is to record it as comments or as a short content outline at the top of your working file, then compare the page against it.
<!--
Content ranking for the home page
Must: name, reserve and call links, hours, address
Should: menu summary
Could: story, press quotes
Won't: newsletter pop-up (moved to /news)
-->When someone asks "why is the story below the menu?", the answer is in the file.
Check your page against the ranking
You can test your result without any CSS. Open the page in a browser with styles turned off, or read your HTML from top to bottom. Ask three questions.
- Can a visitor with the main task finish it using only the first screenful?
- Does anything above a "Must" block belong lower?
- Is anything on the page that no task needs?
If the answers are yes, no and no, the ranking works. Later chapters add layout, but they build on this order.
Exercise
A clinic's contact page has these blocks: a team photo banner, the clinic's history, a booking form with eight fields, the phone number and address, opening hours, and a map embed. Visitors mostly come to find out when the clinic is open and how to reach it. Rank the blocks into Must, Should, Could and Won't (here), and name one change you would make to the booking form for mobile.
Show answer
Must: phone number and address, opening hours. Should: a shortened booking form, and a link to the map. Could: the clinic's history. Won't (here), or moved lower: the team photo banner, because it supports no task and takes up a full screen on a phone. The map embed is heavy, so replace it with a link to open directions, or load it only on request. For the form, cut it down to the fields needed to make a booking (for example name, phone number and preferred time) and move the other fields to a follow-up step, because each field costs space and the on-screen keyboard covers much of the screen.
Exercise
Why is it usually better to put your ranking into the HTML source order than to reorder blocks later with CSS?
Show answer
A single-column layout follows source order, so the ranked order appears on a phone with no extra CSS. Screen readers and keyboard users also move through the page in source order, so they get the same priorities. If CSS changes the visual order, what people see no longer matches what keyboard and screen reader users experience, which is confusing.