HTML tags: The building blocks of the web
HTML (Hypertext Markup Language) forms the basis of the World Wide Web. A language used to structure content and define relationships between different elements on a web page. HTML uses a set of predefined tags to accomplish this, each with a specific purpose. In this article, we will explore some important HTML tags and help you start your web development journey.
1. "" and ""
Every HTML document starts with the "" tag, which functions as the root element. Inside the tag you will find the
tag. The "" tag contains metadata such as the document name and links to external resources.Implementation:
<! DOCTYPE html>
<html>
<head>
<title>My first website</title>
</head>
<body>
<! - Content goes here ->
</body>
</html>
2. ""
The
tag is where the main content of a web page is located. This is where you will post text, images, videos, and other elements that users will see and interact with.Implementation:
<body>
<h1>Welcome to our site</h1>
<p> This is an example of a paragraph of text. </p>
<img src="image.jpg" alt="Landscape from Ova..">
</body>
3. Tag "" to ""
"
The header tag is used to define headers and headers on a page. The tag "
" represents the top level, "" represents the bottom level.
Implementation:
<h1>Main Title</h1>
<h2> header </h2>
<h3> subtitle </h3>
<! - ... ->
4. <p>
- Paragraph
The
tag is used to create a paragraph of text. An important note to structure your content and improve its readability.
Implementation:
<p> This is a paragraph of text. It can contain <em>song</em> or <strong>strong</strong> text. </p>
5. <a>
- Link
Implementation:
<a href="https://www.example.com">Enter example website</a>
6. <img>
- Image
The tag is used to display an image on a web page. It requires the "src" attribute to point to the image file and the "alt" attribute to access it.
Implementation:
<img src="image.jpg" alt="Beautiful Sunset">
7. "" and "- " is an unordered list
The tags "
- " (unordered list) and "
- " (list elements) are used to create a reading list. Lists are great for presenting information in a structured way.
Implementation:
<ul> <li>Item 1</li> <li>Item 2</li> <li>3rd element </li> </ul>
8. "
- " and "
- " - Ordered list
Similar to the unordered list, the "
- " (listed list) and "
- " tags are used to create a numerical list.
Implementation:
<ol> <li>The first step</li> <li>Second Step</li> <li>Third Step</li> </ol>
The results
HTML tags are an important part of web development. With these key points, you can create a website that builds content and attracts users effectively. As you continue to learn, you will discover more advanced features and techniques that allow you to create dynamic and interactive websites. Happy coding!