Lesson 1: Basic Tag Explanation
In the previous lesson, you learned about the basic structure of an HTML document. Now in this lesson, let's go over the core tags you saw in that example.
📌 Based on the Previous Code (Important)
- <html> — Defines the root of the HTML document and tells the browser this is an HTML file.
- <head> — Contains meta information about the document, such as the title and links to CSS or scripts.
- <title> — Sets the title that appears in the browser tab. It goes inside the
<head> section.
- <body> — Holds all the visible content shown on the webpage such as text, images, and buttons.
- <h1> — Represents the main heading of the page. Headings range from
<h1> to <h6>.
- <p> — Defines a paragraph of text. Paragraphs help separate and organize written content.
<title> Tag Example
The most important part you'll focus on inside the <head> for now is the <title> tag.
<head>
<title>Webpage</title>
</head>
Body Tag
The HTML <body> tag defines the main content of the HTML document. This is the section that will be directly visible on your webpage.
Here's a simple example:
<body>
<h1>Welcome to My Website</h1>
<p>This is a sample paragraph.</p>
</body>