In the last module, we learned how an HTML page is organized. In this module, we will learn how to add words and sentences to our webpage. We will learn about headings, paragraphs, line breaks, and text formatting.
Headings are titles used to organize information on a webpage. Just like a book has chapter titles, a webpage uses headings.
HTML has six heading levels:
<h1>Biggest Heading</h1> <h2>Second Biggest Heading</h2> <h3>Third Biggest Heading</h3> <h4>Fourth Heading</h4> <h5>Fifth Heading</h5> <h6>Smallest Heading</h6>
Think of headings as signboards in a shopping mall. They help people know where to go and what they are reading.
A paragraph is a group of sentences. In HTML, we use the <p> tag for paragraphs.
<p>My name is Tolu.</p> <p>I love playing football.</p>
Imagine telling a story. Each new idea goes into a new paragraph.
Sometimes we want text to move to a new line. We use the <br> tag.
My name is Tolu.<br> I am 10 years old.<br> I love football.
The browser will show each sentence on a new line.
Think of pressing the Enter key on your keyboard. The <br> tag does the same thing.
A horizontal line separates sections of a webpage. We use the <hr> tag.
<h1>My Hobbies</h1> <hr> <p>I enjoy football and reading books.</p>
The browser will draw a line across the page.
Bold text is darker and stronger. We use the <strong> tag.
<p>My favourite subject is <strong>Mathematics</strong>.</p>
My favourite subject is Mathematics.
Italic text leans to one side. We use the <em> tag.
<p>I love <em>football</em>.</p>
I love football.
Comments are notes written for programmers. Visitors cannot see comments on the webpage.
<!-- This is my webpage -->
Think of comments as secret notes written in your notebook. Only the person reading the notebook can see them.
<!DOCTYPE html>
<html>
<head>
<title>About Me</title>
</head>
<body>
<h1>About Me</h1>
<p>My name is Tolu.</p>
<p>I am 10 years old.</p>
<p>I love <strong>football</strong> and
<em>video games</em>.</p>
<hr>
<p>Thank you for visiting my page.</p>
</body>
</html>
Write the correct HTML tag:
Create a webpage called myhobbies.html.
Include:
Fix the missing tags below:
______ My School ______ ______ I love learning science. ______ ______ ______ My favourite subject is Mathematics. ______
Use:
Create a webpage called aboutme.html.
Add: