diff --git a/files/en-us/web/html/reference/elements/hr/index.md b/files/en-us/web/html/reference/elements/hr/index.md index fa2aa9f85d4eb61..1606b341edf869f 100644 --- a/files/en-us/web/html/reference/elements/hr/index.md +++ b/files/en-us/web/html/reference/elements/hr/index.md @@ -6,7 +6,7 @@ browser-compat: html.elements.hr sidebar: htmlsidebar --- -The **`
`** [HTML](/en-US/docs/Web/HTML) element represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section. +The **`
`** [HTML](/en-US/docs/Web/HTML) element represents a thematic break between elements: for example, a change of scene in a story, or a shift of topic within a section. {{InteractiveExample("HTML Demo: <hr>", "tabbed-shorter")}} @@ -56,25 +56,88 @@ This element's attributes include the [global attributes](/en-US/docs/Web/HTML/R ## Example -### HTML +### Thematic break between paragraphs + +The following example adds a thematic break between paragraph-level elements. + +#### HTML ```html -

- This is the first paragraph of text. This is the first paragraph of text. This - is the first paragraph of text. This is the first paragraph of text. -

+
+

+ This is the first paragraph of text. This is the first paragraph of text. + This is the first paragraph of text. This is the first paragraph of text. +

+
+

+ This is the second paragraph of text. This is the second paragraph of text. + This is the second paragraph of text. This is the second paragraph of text. +

+
+``` -
+#### Result + +{{EmbedLiveSample("Thematic break between paragraphs")}} + +### Thematic break between list items + +The `
` tag can be placed within a list item for visual separation, to create a separator between sections of a list. + +#### HTML + +```html + +``` -

- This is the second paragraph of text. This is the second paragraph of text. - This is the second paragraph of text. This is the second paragraph of text. -

+```css hidden +ul { + list-style-type: none; + display: flex; + flex-direction: column; + gap: 0.25rem; + width: 100px; + margin: 0.75rem; + padding: 0.75rem; + border: 1px solid lightgrey; +} +hr { + margin-block: 0.2rem; + color: lightgrey; +} +``` + +#### Result + +{{EmbedLiveSample("Thematic break between list items")}} + +### Thematic break between select options + +The `
` element is allowed inside a ` + +
+ + +
+ + + ``` -### Result +#### Result -{{EmbedLiveSample("Example")}} +{{EmbedLiveSample("Thematic break between select options")}} ## Technical summary