The hr
tag represents a thematic break in the content — often rendered as a horizontal line. It visually separates sections or topics in a webpage.
✅ Basic Syntax
<hr>
- Self-closing tag (void element) — no closing tag needed.
- It inserts a horizontal line across the width of its containing element.
🎯 Typical Use Cases
- Separate paragraphs or sections
- Indicate a shift in topic or scene
- Visually organize content for better readability
🎨 Styling Example (CSS)
By default, <hr>
appears as a simple gray line, but it can be styled:
hr {
border: none;
height: 2px;
background-color: #333;
margin: 20px 0;
}
⚠️ Notes
- The
<hr>
tag is semantic, meaning it’s more than just a decorative line; it signals a thematic break in content. - Should be used thoughtfully — not just for decorative purposes.
✅ Summary
Feature | <hr> Tag |
---|---|
Purpose | Insert thematic break / horizontal line |
Tag Type | Void (self-closing) |
Display | Horizontal line by default |
Semantic Meaning | Thematic break in content |