Published by Patrick Mutisya · 8 days ago
By the end of this lesson you will be able to apply the following HTML tags to text within a web page so that the text displays the predefined styles:
<h1> – Main heading<h2> – Secondary heading<h3> – Tertiary heading<p> – Paragraph<i> – Italic textSemantic tags give meaning to the structure of a page. Search engines, assistive technologies and browsers can interpret the content correctly, improving accessibility and SEO.
All HTML tags follow the pattern <tagname>content</tagname>. The opening tag may contain attributes, but for this lesson we focus on the content only.
The heading tags create a hierarchy of importance. Only one <h1> should appear per page.
<h1>Welcome to My Website</h1>
<h2>About the Author</h2>
<h3>Contact Details</h3>
The <p> tag defines a block of text. Browsers automatically add a margin before and after each paragraph.
<p>This is a simple paragraph that explains the purpose of the page.</p>
The <i> tag renders text in an italic style, typically used for titles of works, foreign words, or emphasis.
<p>The novel <i>Pride and Prejudice</i> was written by Jane Austen.</p>
The following example demonstrates how the tags combine to create a simple, well‑structured page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sample Page</title>
</head>
<body>
<h1>My First Web Page</h1>
<h2>Introduction</h2>
<p>Welcome to my website. Here you will find information about my hobbies and projects.</p>
<h3>My Favourite Book</h3>
<p>I enjoy reading <i>The Hobbit</i> by J.R.R. Tolkien.</p>
</body>
</html>
myprofile.html.<h1> with your name.<h2> titled “Biography”.<p>.<h3> called “Favourite Quote”.<i> to italicise the quote.<h1> on a single page.<h1> directly to <h3>).<p>) inside inline tags (like <i>).| Skill | Demonstrated? | Comments |
|---|---|---|
Use of <h1> for main title | ||
Correct hierarchy of <h2> and <h3> | ||
Paragraphs created with <p> | ||
Italic text using <i> | ||
| HTML validates as HTML5 |