Website Authoring

Section: Applications  |  Syllabus: Cambridge IGCSE Information and Communication Technology (0417)

Web Development Layers

A web page is built from three separate layers, each with its own job:

LayerPurpose
Content layerUsed to enter the content and create the structure of a web page (HTML)
Presentation layerUsed to display and format elements within a web page (CSS)
Behaviour layerA scripting language used to control elements within a web page (e.g. responding to a button click)

Create a Web Page (HTML — The Content Layer)

Purpose of Key Metatags

Metatag PurposeWhat It Defines
CharsetThe character encoding used by the page, e.g. UTF-8
KeywordsWords to help search engines find the page
AuthorWho wrote the web page
DescriptionA short summary of the web page
ViewportMakes the web page display correctly on different devices/screen sizes

Use Stylesheets (CSS — The Presentation Layer)

Worked Example: Translating a Style Specification into CSS

Question: A website's style specification states that all heading level 1 (h1) text must be: colour hex code CC0000, font Arial (or the browser's default sans-serif font if Arial is unavailable), 32 points high, and centre-aligned. Write the CSS rule needed to implement this specification.

Each requirement in the plain-English specification maps onto one CSS property: colour needs the "color" property, font needs a "font-family" list with a fallback, size needs "font-size", and alignment needs "text-align". The specification explicitly gives a fallback font, so the font-family list must include both Arial and a generic sans-serif option, in that order. Answer

h1 color: #CC0000; font-family: Arial, sans-serif; font-size: 32pt; text-align: center;

Common Mistakes

MistakeUsing an absolute file path (e.g. a full local folder path or drive letter) to attach a stylesheet or link to another local page

Fixan absolute path only works on the exact computer/location it was written on; a relative path (e.g. "styles/main.css") keeps working wherever the whole site folder is moved to

MistakeForgetting that an inline style or a later-attached stylesheet can silently override an earlier CSS rule

Fixwhen a page doesn't look as expected, check the stylesheet hierarchy — an inline style attribute, or a second stylesheet attached after the first, takes priority over an earlier rule for any property they both set

Interactive revision notes, videos and practice questions load below.

Related: Past Papers Topical Questions IGCSE Computer Science Grade Boundaries Command Words