Skip to main content
ScotlandComputer ScienceSyllabus dot point

How do HTML and CSS build the content and appearance of a web page?

HTML and CSS: building page content and hyperlinks with HTML elements, and controlling appearance with CSS using element, class and id selectors and common properties.

An SQA National 5 Computing Science answer on HTML and CSS, covering how HTML elements build the structure and content of a page including headings, paragraphs, images and hyperlinks, and how CSS controls appearance using element, class and id selectors with common properties such as colour, font and size.

Generated by Claude Opus 4.811 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this key area is asking
  2. HTML: building the content
  3. Hyperlinks
  4. CSS: controlling the appearance
  5. CSS selectors: element, class and id
  6. Why HTML and CSS matter
  7. How this key area is examined
  8. For the official course specification

What this key area is asking

The SQA wants you to build the content of a web page with HTML elements, including hyperlinks, and to control its appearance with CSS using element, class and id selectors and common properties.

HTML: building the content

HTML describes what is on the page: a heading, some paragraphs, an image, a list, a link. Most elements have an opening tag and a matching closing tag with the content in between; the browser reads these tags to display the page.

The two essential parts are the href (where the link goes) and the link text (what the user clicks). A link can point to another page in the same site (fixtures.html) or to an external website (a full web address).

CSS: controlling the appearance

CSS describes how the page looks, kept separate from the HTML that describes what is on it. This separation means you can change the whole look of a site by editing the CSS without touching the content.

CSS selectors: element, class and id

Choosing the right selector matters: use an element selector to style all of a kind at once, a class to style a chosen group, and an id to style one unique element. This is a frequently examined distinction.

Why HTML and CSS matter

Separating content (HTML) from appearance (CSS) is the core idea of modern web development. HTML provides the structure and the hyperlinks that connect the site; CSS provides a consistent look that can be changed in one place. Understanding the selectors lets you apply styles precisely - to everything, to a group, or to a single element.

How this key area is examined

Questions ask you to write HTML for content or a hyperlink, read HTML or CSS and say what it produces, or explain the difference between element, class and id selectors. The reliable marks come from correct tags with closing tags, a hyperlink with the right href and link text, and matching each CSS selector to what it targets (all of a type, a class, or one id).

For the official course specification

The SQA publishes the full National 5 Computing Science course specification, specimen question papers and coursework tasks at sqa.org.uk. Always revise from the current specification and SQA past papers, because question style and terminology are board-specific.

Exam-style practice questions

Practice questions written in the style of SQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

SQA N5 style3 marksWrite the HTML to create a hyperlink with the text 'Fixtures' that opens the page fixtures.html.
Show worked answer →

Three marks for the anchor element, the href attribute and the link text.

HTML:

Fixtures

Markers reward the anchor tag a, the href attribute set to the correct page (fixtures.html), and the visible link text (Fixtures) between the opening and closing tags. Forgetting the href, or putting the text outside the tags, would lose marks. The closing tag should also be present.

SQA N5 style4 marksExplain the difference between an element selector and a class selector in CSS, and give one advantage of using a class.
Show worked answer →

Two marks for the two selector types, one for an example, one for the advantage.

An element selector applies a style to every element of that type, for example styling all paragraphs with p { ... }.

A class selector applies a style only to elements given that class with class="...", for example .warning { ... } styles only elements with class="warning".

Advantage of a class: the same style can be applied to a chosen group of elements across the site without affecting every element of a type, giving more control and reuse.

Markers reward "element selector styles all elements of a type", "class selector styles only elements with that class", and a sensible advantage such as selective, reusable styling.

Related dot points

Sources & how we know this