ETC5523: Communicating with Data
Tutorial 7: Rescue a Quarto page with CSS
🎯 Objectives
By the end of this tutorial, you will be able to:
- inspect a rendered page before changing its source;
- apply small CSS changes without affecting unrelated elements;
- brief an LLM with a target, context, constraints and a check; and
- test whether a design communicates as intended.
Download and unzip the starter mini-site, then open the folder as a project in your usual editor. No packages or data preparation are required.
1. Diagnose before editing (5 minutes)
Open a terminal in the starter folder and run:
quarto previewRead the page as if you were a time-poor local-government communications officer. Without opening styles.css, record:
- three choices that weaken readability or visual hierarchy;
- the one result that should attract attention; and
- the information that should remain visible but secondary.
2. Inspect before changing the code (10 minutes)
Right-click the finding and choose Inspect. In the browser developer tools:
- locate the container with class
.finding; - locate the second-level heading inside it;
- test
border-left: 6px solid #006DAE;on the container; and - identify which existing rules affect every paragraph and every second-level heading.
Browser edits are temporary. Reload the page to prove that your test has not changed the source.
Discuss: why would adding new rules for p or h2 be risky here? Write selectors that would target only the finding heading and only the methods note.
3. Brief and check an LLM (15 minutes)
Write a prompt for the smallest CSS change that makes .finding prominent. Include all four parts:
| Part | What the prompt must specify |
|---|---|
| Target | the exact class to change |
| Context | a Quarto HTML website and the relevant source |
| Constraints | what must remain unchanged |
| Check | an observable description of success |
Ask for the CSS and a short explanation of each declaration. Do not paste private or assessed material into a tool unless its terms permit this.
If you are not using an LLM, critique this candidate instead:
.important-finding h2 {
color: blue !important;
}Before accepting any response, check that its selector exists, !important is justified, declarations are valid, and unrelated headings remain unchanged after a clean render.
4. Complete the page rescue (10 minutes)
Replace the deliberately poor rules in styles.css. Make three restrained changes:
- restore a readable page background, text colour and line spacing;
- emphasise only
.findingwith a left border and spacing; and - distinguish
.methods-noteas secondary information.
Define named colours once in :root. Keep data colours and content out of the stylesheet. Add one sentence below the methods note explaining why your hierarchy suits the stated audience.
5. Test as a reader (5 minutes)
Check the page at desktop width and in a narrow browser window. Give a partner 20 seconds with the page, then ask:
- What changed, and by how much?
- What does “visit” mean, and what can these data not establish?
Do not explain your intention before they answer. Make one revision based on what they actually noticed, then run quarto render.
Optional extension: transfer one rule
Copy one scoped rule into your Assignment 3 website. Inspect its HTML first, adapt the selector if necessary, and confirm that it works on more than one page and at narrow width.