HTML elements are the building blocks of a web page. They are the individual components that make up the structure and content of the page. Here are some of the most common HTML elements:
- Headings: These are used to create titles or subtitles for sections of content. There are six levels of headings, from h1 to h6. For example:
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Sub-subheading</h3>
- Paragraphs: These are used to create blocks of text. For example:
<p>This is a paragraph.</p>
- Lists: These are used to create lists of items, either ordered or unordered. For example:
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
- Links: These are used to create clickable links to other pages or resources. For example:
<a href="https://www.example.com">Link Text</a>
- Images: These are used to display images on the page. For example:
<img src="image.jpg" alt="Image Description">
- Divs: These are used to group together elements for styling or other purposes. For example:
<div class="content">
<h1>Main Heading</h1>
<p>This is a paragraph.</p>
</div>
These are just a few examples of HTML elements. There are many others, including forms, tables, and more. By combining these elements in different ways, you can create complex and dynamic web pages.
Here are some more HTML elements:
- Forms: These are used to create input fields, buttons, and other interactive elements that allow users to enter data or interact with the web page. For example:
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<input type="submit" value="Submit">
</form>
- Tables: These are used to display tabular data. For example:
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>john@example.com</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>jane@example.com</td>
</tr>
</tbody>
</table>
- Head: This is used to create the header section of a web page, which typically includes the page title and other information such as links to stylesheets and scripts. For example:
<head>
<title>Page Title</title>
<link rel="stylesheet" href="styles.css">
<script src="script.js"></script>
</head>
- Footer: This is used to create the footer section of a web page, which typically includes information such as copyright notices and links to related pages or resources. For example:
<footer>
<p>Copyright © 2023 Example Company</p>
<a href="https://www.example.com/about">About Us</a>
</footer>
These are just a few more examples of HTML elements. HTML is a rich and flexible language, and there are many more elements available for creating different types of content and interactivity on a web page.