Be able to create the presentation layer of a web page

ICT 0417 – Website Authoring: Presentation Layer

21 Website Authoring – Presentation Layer

Learning Objective

Be able to create the presentation layer of a web page using HTML and basic CSS techniques.

1. What is the Presentation Layer?

The presentation layer defines how a web page looks to the user. It includes the arrangement of text, images, links, tables, lists and the visual styling such as colours, fonts and spacing.

2. Basic Structure of an HTML Document

Every web page starts with a standard skeleton:

<!DOCTYPE html>
<html>
    <head>
        <title>Page title</title>
    </head>
    <body>
        ...content goes here...
    </body>
</html>
    

The <head> contains meta‑information, while the <body> holds the visible content.

3. Core HTML Elements for Presentation

3.1 Headings

Headings organise content hierarchically. Use <h1> to <h6> – the higher the number, the lower the importance.

3.2 Paragraphs

Wrap blocks of text in <p> tags.

3.3 Lists

Two main types:

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

3.4 Links

Create hyperlinks with the <a> element:

<a href="https://www.example.com">Visit Example</a>
    

3.5 Tables

Tables organise data in rows and columns. Use <table>, <thead>, <tbody>, <tr>, <th> and <td>.

3.6 Forms (basic)

Forms collect user input. Basic elements include <input>, <textarea>, <select> and <button>.

4. Adding Simple Presentation with CSS

CSS (Cascading Style Sheets) controls visual style. For the IGCSE exam you only need to know:

  • Inline style attribute – e.g., <p style="color:blue;">
  • Internal style block placed inside <head> (no external files required).

4.1 Inline Styling Example

<p style="font-family:Arial; font-size:14px; color:#333333;">
    This paragraph uses an inline style.
</p>
    

4.2 Internal Style Sheet Example

<head>
    <style>
        body { background-color:#f9f9f9; }
        h2   { color:#006699; }
        .important { font-weight:bold; }
    </style>
</head>
    

5. Common Presentation Tags and Attributes

Tag / Attribute Purpose Example
<h1> – <h6> Headings (semantic hierarchy) <h2>Section title</h2>
<p> Paragraph of text <p>This is a paragraph.</p>
<ul> / <ol> + <li> Unordered / ordered lists <ol><li>First</li><li>Second</li></ol>
<a href=""> Hyperlink <a href="page.html">Link</a>
<table> + <thead> + <tbody> Tabular data See example in section 3.5
style attribute Inline CSS <span style="color:red;">Red text</span>
<div class=""> Block‑level container for grouping <div class="header">...</div>
<span> Inline container for styling part of text <span style="font-weight:bold;">Bold</span>

6. Step‑by‑Step Example: Building a Simple Web Page

  1. Create the HTML skeleton.
  2. Add a heading and a paragraph.
  3. Insert an ordered list of three items.
  4. Place a table with a header row and two data rows.
  5. Apply basic styling using an internal style block.

6.1 Full Code Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>My First Web Page</title>
    <style>
        body { font-family:Helvetica,Arial,sans-serif; margin:20px; }
        h2   { color:#2A7AE2; }
        table { border-collapse:collapse; width:60%; }
        th, td { border:1px solid #999; padding:8px; text-align:left; }
        .highlight { background-color:#FFEB99; }
    </style>
</head>
<body>

    <h2>Welcome to My Page</h2>

    <p>This paragraph demonstrates <strong>basic formatting</strong> and the use of an inline style:
        <span style="color:#006600;">green text</span>.</p>

    <h3>Steps to Follow</h3>
    <ol>
        <li>Plan the layout.</li>
        <li>Write the HTML structure.</li>
        <li>Add CSS for presentation.</li>
    </ol>

    <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>

    <p>For more information visit <a href="https://www.w3schools.com">W3Schools</a>.</p>

</body>
</html>
    

7. Common Pitfalls to Avoid

  • Forgetting to close tags – e.g., <p> without </p>.
  • Using block‑level elements inside inline elements (e.g., placing a <div> inside a <span>).
  • Mixing presentation (CSS) with content (HTML) – keep styling in style attributes or internal style blocks, not in the content itself.
  • Neglecting the alt attribute for images (even though images are not shown here, remember it for real projects).

8. Suggested Diagram

Suggested diagram: Flowchart showing the relationship between HTML structure, CSS styling, and the final rendered web page.

9. Quick Revision Checklist

  1. Can you write the basic HTML skeleton?
  2. Do you know how to use headings, paragraphs, lists and tables?
  3. Can you create a hyperlink with <a>?
  4. Are you comfortable applying inline CSS and an internal style sheet?
  5. Can you validate that all tags are properly closed?