Publish in HTML Tutorial el 24/05/2025 15:21
The <hr>
element, which stands for "horizontal rule", is used to create a thematic break or divider between sections of content. Originally designed as a simple horizontal line, modern HTML5 redefines it as a semantic element representing a paragraph-level thematic break.
While visually it typically appears as a horizontal line by default, its primary purpose is semantic - to indicate a change of topic or scene within a document. The appearance can be customized with CSS.
Here's how the basic <hr>
tag looks in HTML:
And here's how it renders:
A simple divider between two sections of an article:
Customizing the appearance of the horizontal rule:
Making the HR element interactive with JavaScript:
Using CSS to create a vertical divider (not a true HR element, but a common alternative):
Creating an animated divider that changes over time:
<hr>
for thematic breaks, not just for visual separation.color
property. Use background-color
and height
for better control.The <hr>
element is supported by all browsers, including legacy ones. However, the default styling may vary slightly between browsers, so for consistent appearance, always specify your own styles.
The <style> HTML element contains style information for a document, or part of a document. ...
The <strong> element is used to indicate that its content has strong importance, seriousnes...
The <span> element is an inline container used to mark up a part of a text or document. Unl...
The <source> element is used to specify multiple media resources for media elements like &l...
The <small> element is used to represent side-comments and small print, typically for discl...
HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...