An HTML document is a file that tells a web browser what to show on a webpage. Think of it as a recipe for baking a cake. The recipe tells you what ingredients to use and what steps to follow. In the same way, an HTML document tells the browser what to display.
Imagine building a toy house. Every toy house needs a foundation, walls, a roof, and rooms. An HTML document also has parts that work together to build a webpage.
HTML uses special words called tags. Tags tell the browser what each piece of content is.
Most tags come in pairs:
<tag> Content goes here </tag>
<p>I love football.</p>
The <p> tag means paragraph.
Think of tags as sandwich bread. One slice starts the sandwich and another slice ends it. The filling is the content in the middle.
Every HTML page follows a structure.
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
Welcome to my webpage!
</body>
</html>
The head section is like the cover page of a school notebook. It contains information about the webpage.
<head>
<title>My School Website</title>
</head>
The title appears on the browser tab.
If your title is "My School Website", that name will appear at the top of the browser tab.
The body section contains everything visitors can see.
<body>
Hello Everyone!
</body>
Whatever is inside the body appears on the webpage.
If a website is a house, the body is all the furniture, pictures, and decorations inside it.
<!DOCTYPE html>
<html>
<head>
<title>About Me</title>
</head>
<body>
My name is Tunde.
I am 10 years old.
I love playing football.
</body>
</html>
Save this file as aboutme.html and open it in your browser.
Match the HTML part with its meaning:
| HTML Part | Meaning |
|---|---|
| <html> | _____________ |
| <head> | _____________ |
| <body> | _____________ |
| <title> | _____________ |
Create a webpage called myfamily.html.
Add:
Fill in the missing tags:
<!DOCTYPE html>
<_____>
<head>
<title>My Page</title>
</head>
<_____>
Hello World!
</_____>
</html>
Create a webpage called myschool.html.
Include: