HTML (HyperText Markup Language) is a markup language used to create web pages. HTML defines the structure of web content using elements and tags. In this lesson, we will learn the basic HTML elements, how to use them correctly, and what common mistakes to avoid.
<!DOCTYPE html>
TagThis tag indicates the document type and HTML version. Most modern web pages use the following line:
<html>
TagThe <html>
tag serves as a container for all the content of a web page. It starts with <html>
and ends with </html>
:
<head>
TagThe <head>
tag contains metadata such as the page title, links to styles, and scripts:
My First Web Page
<body>
TagThe <body>
tag contains all the visible content of the web page:
Hello, World!
This is my first paragraph.
<h1>
– <h6>
)Headings are used to create titles of different levels:
First-Level Heading
Second-Level Heading
Paragraphs (<p>
)
Paragraphs are used to create text:
This is an example paragraph.
Links (<a>
)
Links are used to navigate to other pages or resources:
Images (<img>
)
Images are added using the <img>
tag, which does not have a closing tag:
Lists
Ordered Lists (<ol>
)
The <ol>
tag is used to create ordered (numbered) lists, and the <li>
tag is used for list items.
- First item
- Second item
- Third item
Unordered Lists (<ul>
)
The <ul>
tag is used to create unordered (bulleted) lists, and the <li>
tag is used for list items.
- First item
- Second item
- Third item
<div>
Tag
The <div>
tag is used as a container for grouping other elements and applying styles to them using CSS.
Heading in a container
Text inside the container.
<span>
Tag
The <span>
tag is used to group text within other elements for applying styles.
This is red text.
Common Mistakes
Each opening tag (except for self-closing ones) must have a corresponding closing tag.
Paragraph text
Paragraph text
Some tags require mandatory attributes. For example, the <img>
tag requires the src
attribute:
Do not use deprecated tags such as <center>
and <font>
. Instead, use CSS for styling.
Centered text
Centered text
<meta charset="UTF-8">
TagDon’t forget to add the meta tag to specify the character encoding.
In this lesson, we covered the basic HTML tags and their proper usage. Understanding the fundamentals of HTML is the first step in creating web pages. Avoid common mistakes and stay updated with current standards.
Create a simple web page containing the following elements:
My First Web Page
My First Web Page
This is a description of my first web page. I am learning to create HTML markup.
Go to my favorite website
Ordered List
- First item
- Second item
- Third item
Unordered List
- First item
- Second item
- Third item
Check your work for errors and make sure the page is displayed correctly in the browser.
Phone: +375 33 910-08-92
Email: info@codefor.tech
Address: Baranovichi, st. Pirogova, 7
© 2024-2025 All rights reserved. CodeFor.