HTML: recognise the structure of a web page

Learning objective 11.5.3.1 identify common elements of a web page structure

HTML: recognise the structure of a web page

Two students organising content for a website on a laptop

Why does structure matter?

You open a school club page to find its meeting time. The title tells you which club it is, the menu takes you to the schedule, and the contact information appears at the end. Recognising these regions helps you find information and read the HTML behind the page. Clear structure also helps assistive technologies navigate content.


1. Recall what you know

Pair activity · 5 minutes. Write the HTML for the following items, then compare with a partner.

  1. A heading “Coding Club” and a paragraph containing an important word and an emphasised word.
  2. A table with two column headings, Day and Activity, and one data row: Tuesday / HTML.
  3. An image named club.png with meaningful alternative text.
  4. A link labelled “Computer Science resources” to https://www.bzfar.org/.
Show sample answers
<h1>Coding Club</h1>
<p>Learn <strong>HTML</strong> and practise <em>together</em>.</p>
<table>
 <tr><th scope="col">Day</th><th scope="col">Activity</th></tr>
 <tr><td>Tuesday</td><td>HTML</td></tr>
</table>
<img src="club.png" alt="Students coding together">
<a href="https://www.bzfar.org/">Computer Science resources</a>

strong marks importance; em marks emphasis. CSS controls how these elements look. The image description must match the actual image.


2. HTML document or visible page?

HTML means HyperText Markup Language. It marks the content and structure of a document. CSS controls presentation, including colour, spacing, and layout.

Use HTML and CSS editor

<!DOCTYPE html>
<html lang="en">
 <head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <title>Coding Club</title>
 <link rel="stylesheet" href="style.css">
 </head>
 <body>
 <h1>Coding Club</h1>
 <p>Welcome to our club.</p>
 </body>
</html>
Part What to recognise
<!DOCTYPE html> A declaration that requests standards mode; it is not an HTML element.
html The root element containing the document.
head Document information: the tab title, metadata and stylesheet links.
body The page content, including text, images and links.

Do not confuse them: head stores document information. A header is introductory content in the page body. The title supplies the browser tab title; h1 is a heading in the page.

Tag, element and attribute

<a href="https://www.bzfar.org/">Resources</a>
  • <a> and </a> are opening and closing tags.
  • The opening tag, content, and closing tag together form this element.
  • href is an attribute; its value gives the destination.
  • A void element such as img has no content and no closing tag. Do not write </img>.

3. Common structural elements

Identify an element by the role of its content, not only by its position or colour.

Element Role School website example
header Introduction to a page or section Club name and welcome message
nav A major set of navigation links About / Schedule / Contact
main The page’s dominant content Club information and timetable
section A thematic group, usually with a heading The “Meeting schedule” section
article A self-contained composition A complete club news post
aside Related, secondary content A reminder to bring a laptop
footer Closing information for a page or section Author, contact or copyright information

Explore a page map

Predict the role of each region. Select a region to reveal its description. You can also use Tab, then Enter or Space.

A · header

School Coding Club — the page introduction.

B · nav

Links to About, Schedule and Contact — major navigation.

C · main — dominant page content

D · section

Meeting schedule — a group of content about one topic, with a heading.

E · article

“Our first coding competition” — a complete news post that makes sense on its own.

F · aside

A related reminder: bring your laptop.

One possible layout. CSS determines the arrangement; semantic HTML describes the roles.

An aside may appear below the main content, not necessarily on the right. A page does not need every element in this list. Use one visible main for its dominant content. A div is a generic container, with no specific semantic role.

Recognise the same elements in code

Use HTML and CSS editor

<header><h1>School Coding Club</h1></header>
<nav><a href="#schedule">Schedule</a></nav>
<main>
 <section id="schedule">
 <h2>Meeting schedule</h2>
 <p>Tuesday, 15:30, Room 12.</p>
 </section>
 <article>
 <h2>Our first coding competition</h2>
 <p>Our team completed its first challenge today.</p>
 </article>
</main>
<aside><p>Remember to bring your laptop.</p></aside>
<footer><p>Contact the club teacher in Room 12.</p></footer>

The section and article are nested inside main. The navigation link points to the section whose id is schedule.


4. CSS revision: three ways to apply styles

Method Where the CSS goes Example
Inline In an element’s style attribute <p style="color:teal;">Hello</p>
Internal Inside a style element in the head <style>p { color: teal; }</style>
External In a separate .css file linked from head <link rel="stylesheet" href="style.css">
/* style.css */
body { font-family: Arial, sans-serif; }
header, footer { background: #d8fffa; padding: 16px; }
h1 { color: #286d60; }

In h1 { color: #286d60; }, h1 is the selector, color is the property, and #286d60 is the value. External CSS can be shared by several pages.

Changing a region’s background does not change its HTML role. CSS priority also depends on the cascade; external CSS is not automatically weaker than internal CSS.


5. Check your understanding

Activity A · Identify the element

Choose one answer for each question. Feedback appears after selection.

1. A group contains the main links to Home, News and Contact. Which element matches this role?
2. Which element contains metadata and the browser tab title?
3. A complete school news post can be reused independently. Which element is the most specific match?
Show the three correct answers
  1. nav
  2. head
  3. article

One mark per correct selection: 3 marks.

Activity B · Match the role

Write the element name for each description. Use each name once: header, main, section, aside, footer.

  1. The page’s dominant content.
  2. A related revision tip next to a tutorial.
  3. The introductory title and welcome message.
  4. The closing author and contact information.
  5. A thematic group headed “Meeting schedule”.
Show matching answers and marks
  1. main
  2. aside
  3. header
  4. footer
  5. section

One mark per correct element: 5 marks. Accept names with or without angle brackets.

Activity C · Read the code

Use the example in Section 3. Identify:

  1. the element containing the link to Schedule;
  2. the element for the laptop reminder;
  3. the element that groups the meeting time;
  4. the attribute that provides the section’s link target.
Show code-reading answers
  1. nav
  2. aside
  3. section
  4. id

One mark per answer: 4 marks. Question 4 revises HTML attributes.


6. Optional hands-on revision

In a text editor, save the document from Section 2 as index.html. Replace its body content with the example from Section 3. Save the three CSS rules from Section 4 in style.css in the same folder.

  1. Open index.html in a web browser.
  2. Select Schedule and check the link destination.
  3. Change the club name, save, and refresh.
  4. Point to header, nav, main, section, article, aside, and footer in your code.

Expected result: a club heading, a Schedule link, a meeting time, a news post, a reminder, and contact details. The header and footer have a pale mint background.


Practice

Create a webpage.

  1. Open a text editor. 
  2. Copy the code above and print it yourself.
  3. Save the document with the extension .html, for example, index.html
  4. Open the HTML document in a web browser.

Use online web page editors to see webpage changes immediately.

Consider using the following tags yourself

Headings Paragraphs Font formatting Hyperlinks Images Tables Lists Block and Inline Elements Forms Forms. Input types Video Audio Bootstrap Starter Templates


Questions:

1. What is HTML used for?
2. What are the two main parts of an HTML document?
3. Explain the concept of a "tag".
4. Give examples of formatting tags, tables, and insertion of objects.


Exercises:

Ex. 0 Markup webpage index.html (download file)

Ex. 1 Matching pairs

Ex. 2 Determine the group for the tag

Ex. 3 Create a webpage using a template:

Use HTML and CSS editor

Ex. 5 Practical work "Implement a ready-made algorithm for creating a landing page using Bootstrap" 


Exam questions:


 

Категория: Programming languages | Добавил: bzfar77 (09.01.2021)
Просмотров: 11040 | Теги: Paragraph, html, head, tag, Heading, body, Attribute | Рейтинг: 5.0/2
Всего комментариев: 0
avatar