Be able to create the presentation layer of a web page

21 Website Authoring – Presentation Layer

Learning objective

Be able to create the presentation layer of a web page using HTML and basic CSS techniques, and understand how it fits with the content and behaviour layers of the Cambridge IGCSE 0417 syllabus.

1 Web‑development layers (content, presentation, behaviour)

LayerPurposeTypical tags / technologies
Content layer Provides the meaning and logical structure of the information. HTML structural tags – <h1>–<h6>, <p>, <ul>, <ol>, <table>, <audio>, <video>, <form>, semantic tags (<header>, <nav>, <section>, <footer>), meta‑tags.
Presentation layer Controls how the content looks to the user. CSS (inline, internal, external), class and id attributes, style‑related HTML attributes.
Behaviour layer Adds interactivity and dynamic responses. JavaScript (or any client‑side scripting). The IGCSE syllabus expects you to recognise JavaScript as the behaviour layer, although you will not be required to write code for it.

2 Basic structure of an HTML document

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Page title</title>               <!-- required – reflects page purpose -->
        <!-- additional meta‑tags go here -->
        <style>
            /* internal CSS (optional) */
        </style>
        <link rel="stylesheet" href="css/style.css">  <!-- external stylesheet – see §5 -->
    </head>
    <body>
        …content goes here…
    </body>
</html>

Checklist for the skeleton (exam tip)

  • <!DOCTYPE html> – declares HTML5.
  • <html lang="en"> – language attribute.
  • <meta charset="UTF-8"> – character set.
  • <title>…</title> – must be present and describe the page.
  • <meta name="viewport" content="width=device-width, initial-scale=1"> – required for responsive design.
  • ✅ Link to an external stylesheet (relative path) or include an internal <style> block.

3 Core HTML elements (content layer) – what the exam expects

3.1 Headings

Use <h1><h6> to create a logical hierarchy. The higher the number, the lower the importance. Example:

<h1>Main title</h1>
<h2>Section heading</h2>
<h3>Sub‑section</h3>

3.2 Paragraphs

Wrap blocks of text in <p>. Inline formatting tags such as <strong>, <em> and <span> may be used inside a paragraph.

3.3 Lists

  • Ordered list – <ol> with <li> items.
  • Unordered list – <ul> with <li> items.

3.4 Links (hyperlinks)

<a href="https://www.example.com">Visit Example</a>
  • target="_blank" – opens the link in a new tab/window.
  • mailto: – opens the default mail client (e.g., <a href="mailto:info@example.com">Email us</a>).
  • Relative vs. absolute paths – see §6.

3.5 Bookmarks (intra‑page links)

<a id="top"></a>                     <!-- bookmark target -->
...
<a href="#top">Back to top</a>      <!-- link to the bookmark -->

3.6 Tables

Use <table> together with <thead>, <tbody>, <tr>, <th> and <td>. Styling is normally done with CSS, but the legacy border and cellpadding attributes are still accepted for simple exam questions.

3.7 Multimedia (audio, video, images)

<audio controls src="media/sound.mp3">Your browser does not support audio.</audio>

<video controls width="320" src="media/clip.mp4">Your browser does not support video.</video>

<img src="images/logo.png" alt="School logo">   <!-- always provide alt‑text -->

3.8 Forms (expanded)

Use <label> (linked via for), <fieldset> (optional grouping), and appropriate input types. Required attributes such as required are examined.

<form action="process.php" method="post">
    <fieldset>
        <legend>Contact details</legend>

        <label for="name">Name:</label>
        <input type="text" id="name" name="name" required><br>

        <label for="email">Email:</label>
        <input type="email" id="email" name="email" required><br>

        <label for="msg">Message:</label>
        <textarea id="msg" name="msg" rows="4"></textarea><br>

        <button type="submit">Send</button>
    </fieldset>
</form>

3.9 Semantic HTML5 tags (exam‑relevant)

Instead of generic <div> elements, use semantic tags to give meaning to page sections:

  • <header> – introductory content or navigation.
  • <nav> – a set of navigation links.
  • <section> – a thematic grouping of content.
  • <article> – self‑contained composition (e.g., a news item).
  • <footer> – footer information, copyright, contact details.

4 Meta‑tags (content layer – required for the exam)

Meta‑tagPurposeExample
<meta name="description" content="Brief page description"> Provides a summary for search engines. <meta name="description" content="Introduction to HTML tables">
<meta name="keywords" content="HTML, CSS, tables"> List of key terms (optional for modern SEO). <meta name="keywords" content="presentation layer, IGCSE">
<meta name="author" content="Your Name"> Identifies the page creator. <meta name="author" content="J. Doe">
<meta name="viewport" content="width=device-width, initial-scale=1"> Ensures proper scaling on mobile devices and enables responsive design. Same as shown.

5 CSS – presentation layer

5.1 Why use CSS?

CSS separates visual style from HTML content, making pages easier to maintain and allowing the same style to be applied to many pages.

5.2 Ways to apply CSS

  • Inlinestyle="…" attribute on an individual element.
  • Internal – a <style> block inside the <head>.
  • External – a separate .css file linked with <link rel="stylesheet">.

5.3 Cascade hierarchy (exam‑relevant order)

  1. Inline styles (highest priority)
  2. Internal style sheet
  3. External style sheet
  4. Browser default styles (lowest priority)

5.4 Specificity tip (beyond the hierarchy)

If two rules have the same origin, the one with the higher specificity wins. The basic order is:

  • ID selector (#header) – highest
  • Class, attribute or pseudo‑class selector (.important, [type="text"], :hover)
  • Element selector (p) – lowest

Example:

p { color: gray; }                 /* element selector */
.highlight { color: blue; }       /* class selector – overrides the element rule */
#main { color: red; }             /* ID selector – overrides both */

5.5 Linking an external stylesheet (relative path)

<head>
    <link rel="stylesheet" href="css/style.css">
</head>

The path must be relative to the HTML file (e.g., css/style.css) when the site is stored locally or uploaded to a server.

5.6 Selectors you must know

  • Class selector.className { … } (applies to any element with class="className").
  • ID selector#idName { … } (applies to the single element with id="idName").
  • Element selector – e.g., p { … }.
  • Descendant selectornav a { … } (targets <a> elements inside a <nav>).

5.7 Simple CSS examples (internal or external)

/* basic page style */
body        { font-family:Helvetica,Arial,sans-serif; margin:20px; background:#f9f9f9; }

/* headings */
h2          { color:#006699; }

/* class and ID */
.important  { font-weight:bold; }
#header     { background:#003366; color:#fff; padding:10px; }

/* table styling */
table       { border-collapse:collapse; width:100%; }
th, td      { border:1px solid #ccc; padding:8px; text-align:left; }

/* responsive tweak – media query (exam‑relevant example) */
@media (max-width: 600px) {
    body { margin:10px; }
    h2   { font-size:1.5em; }
}

6 Relative vs. absolute file paths (exam tip)

  • Absolute path: starts from the root of the web (e.g., https://www.example.com/images/logo.png).
  • Relative path: starts from the location of the current HTML file (e.g., images/logo.png or ../styles/main.css).
  • The IGCSE syllabus expects you to use **relative paths** for local resources (images, CSS, links).

7 Step‑by‑step example: building a simple web page

  1. Create the HTML skeleton (including all required meta‑tags and a <title> element).
  2. Use semantic tags (<header>, <nav>, <section>, <footer>) to give structure.
  3. Add a heading, a paragraph with an inline style, and a bookmark.
  4. Insert an ordered list and an unordered list.
  5. Place a table with a header row and two data rows, using a class to highlight a row.
  6. Embed an audio clip, a video clip and an image (with alt text).
  7. Include a small contact form (with label, required and fieldset).
  8. Apply basic styling with an internal style block, demonstrating a class selector, an ID selector and a media query.

7.1 Full code example (HTML + internal CSS)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="description" content="Simple presentation‑layer example">
    <meta name="keywords" content="HTML, CSS, IGCSE">
    <meta name="author" content="Your Name">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>My First Web Page</title>

    <!-- External stylesheet (relative) -->
    <link rel="stylesheet" href="css/style.css">

    <style>
        /* Internal CSS – overrides external if there is a conflict */
        body { font-family:Helvetica,Arial,sans-serif; margin:20px; background:#f9f9f9; }
        h2   { color:#2A7AE2; }
        .highlight { background:#FFEB99; }
        #logo { width:120px; }

        /* simple responsive rule */
        @media (max-width: 600px) {
            body { margin:10px; }
            h2   { font-size:1.5em; }
        }
    </style>
</head>
<body>

    <!-- Bookmark at the top of the page -->
    <a id="top"></a>

    <header id="header">
        <h1>Welcome to My Page</h1>
        <img src="images/logo.png" alt="School logo" id="logo">
    </header>

    <nav>
        <ul>
            <li><a href="index.html">Home</a></li>
            <li><a href="about.html">About</a></li>
            <li><a href="contact.html">Contact</a></li>
        </ul>
    </nav>

    <section>
        <h2 id="intro">Introduction</h2>
        <p>This paragraph demonstrates basic formatting and an inline style:
            <span style="color:#006600;">green text</span>.</p>

        <h3>Ordered steps</h3>
        <ol>
            <li>Plan the layout.</li>
            <li>Write the HTML structure.</li>
            <li>Add CSS for presentation.</li>
        </ol>

        <h3>Navigation list</h3>
        <ul>
            <li>Item A</li>
            <li>Item B</li>
            <li>Item C</li>
        </ul>

        <h3>Sample data table</h3>
        <table>
            <thead>
                <tr>
                    <th>Item</th>
                    <th>Quantity</th>
                    <th>Price (£)</th>
                </tr>
            </thead>
            <tbody>
                <tr class="highlight">
                    <td>Notebook</td>
                    <td>2</td>
                    <td>3.50</td>
                </tr>
                <tr>
                    <td>Pen</td>
                    <td>5</td>
                    <td>1.20</td>
                </tr>
            </tbody>
        </table>

        <h3>Multimedia</h3>
        <audio controls src="media/sound.mp3">Your browser does not support audio.</audio>
        <br>
        <video controls width="320" src="media/clip.mp4">Your browser does not support video.</video>

        <h3>Contact form</h3>
        <form action="process.php" method="post">
            <fieldset>
                <legend>Send us a message</legend>
                <label for="name">Name:</label>
                <input type="text" id="name" name="name" required><br>

                <label for="email">Email:</label>
                <input type="email" id="email" name="email" required><br>

                <label for="msg">Message:</label>
                <textarea id="msg" name="msg" rows="4"></textarea><br>

                <button type="submit">Send</button>
            </fieldset>
        </form>
    </section>

    <footer>
        <p><a href="#top">Back to top</a> | © 2026 Your Name</p>
    </footer>

</body>
</html>

Create an account or Login to take a Quiz

80 views
0 improvement suggestions

Log in to suggest improvements to this note.