21.2

Topic 21

Create a web page

  • IGCSE I.C.T 0417
  • 3 min read
  • Syllabus 2026, 2027 and 2028

Objectives

  1. 1

    Use HTML in the content layer

    • aCreate the content layer of a web page
    • bPlace appropriate elements in the head section of a web page including: insert a page title to display in the browser; attach external stylesheets (with the correct hierarchy, using a relative file path); metatags to use the appropriate attributes including to define the charset, name attributes (description, keywords, author, viewport), content attributes; default target windows
    • cPlace appropriate content in the body section of a web page
    • dInsert a table including table header, table rows, table data
    • eUse appropriate table attributes to meet the needs of the audience including to adjust cells to span more than one row or column, to set table and cell sizes in terms of pixels or % values, to apply styles to tables
    • fInsert appropriate objects into a web page including text, images, sound clips, video (display controls, remove controls, autoplay), to adjust image or video size, aspect ratio and apply alternate text
    • gUse the <div> tag including to apply styles and classes
    • hApply tags to text within a web page to display pre-defined styles including h1, h2, h3, p, li
    • iApply classes to elements within a web page
    • jApply styles to elements within a web page including to a list (ordered list, unordered list)
    • kCreate a bookmark within a web page using an id attribute
    • lCreate hyperlinks from text and images to: bookmarks on the same page; other locally stored web pages; a website using the URL; send mail to a specified email address; to open in a specified location (the same window, a new window, with a window named as specified)
  2. 2

    The use of HTML in the content layer

    • aPurpose of the head and body sections of a web page
    • bThe reason tables are used to structure elements within a web page
    • cFunction of metatags including to define: the charset, keywords for search engines, the author of the web page, a description of the web page, the viewport (to make your web page display on all devices)
    • dFunction of a hyperlink
    • eConcept of a bookmark including methods of creating a bookmark within a web page
    • fFunction of an anchor
    • gRelative file path and absolute file path including the reason absolute file paths must not be used for hyperlinks to locally saved web pages/objects

Cambridge IGCSE ICT 0417 syllabus 2026-2028, 21.2 Create a web page (copied for internal use as permitted by Cambridge)

Detailed · Deep study

1The head section

<!DOCTYPE html>
<html>
<head>
  <title>Rivers Hotel</title>
  <meta charset="UTF-8">
  <meta name="description" content="Rooms and prices at Rivers Hotel">
  <meta name="keywords" content="hotel, rooms, Mombasa">
  <meta name="author" content="A Student">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="styles/main.css">
  <link rel="stylesheet" href="styles/extra.css">
  <base target="_blank">
</head>
<body>
  <h1>Rivers Hotel</h1>
  <p class="intro">Welcome to our hotel.</p>
</body>
</html>
Head section: title, metatags, two attached stylesheets (relative paths; the last attached has priority) and a default target window.

Purpose of the head and body: the head holds information about the page (title shown in the browser tab, metatags, links to stylesheets) that is not displayed in the page itself; the body holds the content that is displayed.

MetatagFunction
charsetdefines the character set (e.g. UTF-8) so text displays correctly
keywordswords used by search engines to find the page
authorthe author of the web page
descriptiona description of the page, shown in search results
viewportmakes the page display correctly on all devices (scales to the screen width)

2Tables and objects

<table style="width:80%">
  <tr>
    <th colspan="2">Room prices</th>
  </tr>
  <tr>
    <td rowspan="2">Standard</td>
    <td>$60 single</td>
  </tr>
  <tr>
    <td>$90 double</td>
  </tr>
</table>
A table with a header cell spanning two columns and a data cell spanning two rows.

Tables are used to structure elements in rows and columns so they line up, e.g. a layout or a price list. Table and cell sizes can be set in pixels or % of the window; cells can span more than one row or column (rowspan, colspan); styles can be applied to tables.

<img src="images/pool.jpg" alt="Hotel swimming pool" width="400" height="300">
<video width="320" height="240" controls autoplay>
  <source src="media/tour.mp4" type="video/mp4">
</video>
<audio controls><source src="media/welcome.mp3" type="audio/mpeg"></audio>
<div class="offer"><p>Special offer this month</p></div>
<ul><li>Free wi-fi</li><li>Breakfast included</li></ul>
Image with alternate text, video with controls and autoplay, audio, a div with a class, and an unordered list.

3Bookmarks and hyperlinks

<h2 id="contact">Contact us</h2>
<a href="#contact">Go to contact details</a>
<a href="rooms.html">Our rooms</a>
<a href="https://www.example.com" target="_blank">Tourist board</a>
<a href="mailto:book@rivershotel.com">Email us</a>
<a href="map.html" target="mapwindow">Map</a>
<a href="rooms.html"><img src="images/room.jpg" alt="Rooms"></a>
A bookmark (id) and hyperlinks to it, to a local page, to a website in a new window, to an email address, to a named window, and from an image.
TermMeaning
hyperlinktext or an image that, when clicked, opens another location: part of the same page, another page or file, a website, or an email
bookmarka named location in a page, created with an id attribute (e.g. id="contact"), that a link can jump to with #contact
anchorthe <a> tag that creates a hyperlink; its href attribute gives the destination
target_self (same window), _blank (new window), or a name (a window named as specified)
relative file patha path from the current page, e.g. images/pool.jpg – works when the site is moved or uploaded
absolute file patha full path, e.g. C:\Users\A\site\images\pool.jpg – must not be used for local files, because it will not exist on another computer or the web server

4Exam focus

Key words: head; body; title; metatag; charset; viewport; table; colspan; rowspan; alt text; div; class; bookmark; id; hyperlink; anchor; target; relative path; absolute path.

Quick self-check

Answer in your head first, then reveal.

  1. An absolute path points to a location on one computer (1); it will not exist when the site is uploaded/moved, so the image will not display (1).

  2. <a href="mailto:info@abc.com">…</a> (2).

  3. To make the page display correctly on all devices/screen sizes (1).

  4. Gives alternative text describing the image for screen readers / if it does not load (1).

Finished this subtopic? Track it on your subject page.