HTML Empty Elements - chrisbitm/python GitHub Wiki
Empty elements are tags that don’t have any content between opening and closing tags. They are self-contained and don’t require a closing tag. Instead, they serve a specific structural or functional purpose.
This creates a simple Line Break between Text:
<p>Roses are Red.<br>Violets are Blue.<br>You are very ugly.<br>
And yet I am falling even more in love with you.</p>
This inserts a Horizontal Line that acts as a Visual Separator between ambiguous content.
A real-world example of the <hr>
tag is when you want to separate sections in an article, a blog post, or a webpage. Here’s an example of how you might use it:
<h1>Welcome to My Blog</h1>
<p>Hello! I'm excited to share my thoughts with you.</p>
<hr>
<h2>Latest Post: Web Design Tips</h2>
<p>Want to make your website look professional? Here are a few tips...</p>
<hr>
<h2>Contact Me</h2>
<p>If you have any questions, feel free to reach out by contacting me <a href="#">here!</a></p>
- Horizontal Rules can make content easier to read and more organized. It's simple, effective, and widely used across various Websites.
For Local Images, you can use this code:
<img src="Images/Beach_Photo" alt="Summer Bliss">
-
<input>
(user input field) -
<meta>
(metadata) -
<link>
(link to external resources)
These elements often provide essential functionality without needing additional content inside them. If you're working with HTML5, understanding empty elements is useful for structuring pages efficiently. Need help implementing any of these?
You can also use the HTML