A Comprehensive Guide to HTML Tags
1. <!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<!-- Content goes here -->
</body>
</html>
2.<html>
The root element of an HTML document.
<html>
<!-- Content goes here -->
</html>
<html>
<!-- Content goes here -->
</html>
3. <head>
Contains meta-information about the HTML document, such as the title, character set, and linked stylesheets.
<head>
<title>My Webpage</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
</head>
4. <title>
Sets the title of the HTML document, which appears in the browser's title bar or tab.
<title>My Webpage</title>
5. <body>
Encloses the content of the HTML document.
<body>
<h1>Hello, World!</h1>
<p>This is a sample webpage.</p>
</body>
6. Heading Tags (<h1> to <h6>)
Used to define headings, where <h1> is the largest and <h6> is the smallest.
<h1>Main Heading</h1>
<h2>Subheading 1</h2>
<h3>Subheading 2</h3>
7. <p>
Defines a paragraph of text.
<p>This is a sample paragraph.</p>
8. <a>
Creates a hyperlink.
<a href="https://www.example.com">Visit our website</a>
9. <img>
Embeds an image into the document.
<img src="image.jpg" alt="Description of the image">
10. <ul> and <li>
Creates an unordered list and list items.
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
11. <ol> and <li>
Creates an ordered list and list items.
<ol>
<li>First item</li>
<li>Second item</li>
</ol>
12. <table>, <tr>, <td>
Defines a table, table row, and table data.
<table>
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
</tr>
<tr>
<td>Row 2, Cell 1</td>
<td>Row 2, Cell 2</td>
</tr>
</table>
These are just a few of the many HTML tags available for structuring web content. As you continue your journey in web development, exploring and understanding the purpose of each tag will be crucial. Happy coding!

0 Comments