About Lesson
Here are some HTML elements along with examples to illustrate their usage:
<h1>
to<h6>
(Headings):
<h1>This is a Heading</h1>
<h2>This is a Subheading</h2>
<p>
(Paragraph):
<p>This is a paragraph of text.</p>
<a>
(Link):
<a href="https://www.example.com">Visit Example Website</a>
<img>
(Image):
<img src="image.jpg" alt="Description of the image">
Replace "image.jpg"
with the actual path or URL of your image file.
<ul>
and<li>
(Unordered List):
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<ol>
and<li>
(Ordered List):
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
<table>
,<tr>
,<th>
, and<td>
(Table):
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John Doe</td>
<td>30</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>25</td>
</tr>
</table>
<form>
,<input>
, and<button>
(Form):
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name"><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>
<button type="submit">Submit</button>
</form>
<div>
(Division):
<div>
<h3>Section Title</h3>
<p>This is the content of the section.</p>
</div>
<span>
(Inline Container):
<p>This is some text with <span style="color: red;">highlighted</span> word.</p>
<header>
,<nav>
,<main>
, and<footer>
(Semantic Elements):
<header>
<h1>My Website</h1>
</header>
<nav>
<a href="#">Home</a> |
<a href="#">About</a> |
<a href="#">Contact</a>
</nav>
<main>
<h2>Welcome to My Website</h2>
<p>This is the main content of the website.</p>
</main>
<footer>
<p>© 2023 My Website. All rights reserved.</p>
</footer>
These examples demonstrate the usage of various HTML elements for headings, paragraphs, links, images, lists, tables, forms, containers, semantic elements, and more. You can modify and combine these elements to suit your specific needs when building web pages.
Join the conversation