# \<hr>

🔰 [HTML](https://lochiwei.gitbook.io/web/html) ⟩ [Elements](https://lochiwei.gitbook.io/web/html/element) ⟩ \<hr>

{% hint style="success" %}
(Horizontal Rule)

represents a thematic break between paragraph-level elements.
{% endhint %}

{% tabs %}
{% tab title="⭐️ 重點" %}
{% hint style="danger" %}
注意：\
<**hr**> 預設只有 **1px** 的 **border**，**沒有 content height**❗️
{% endhint %}

```css
/* default styles */
hr {
    display: block;
    unicode-bidi: isolate;
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
    margin-inline-start: auto;
    margin-inline-end: auto;
    overflow: hidden;
    
    /* ⭐️ 預設只有 border, 注意：content height = 0❗️ */
    border-style: inset;
    border-width: 1px;
}
```

{% endtab %}

{% tab title="💈範例" %}

* replit ⟩ [style \<hr>](https://replit.com/@pegasusroe/style-lesshrgreater#style.css)

```css
:root {
    --x: 2px;       /* shadow offset */
}

html {
    background-color: tomato;
}

body {
    background-color: #ccc;
    color: #333;
    padding: 1em;
}

hr.gradient {
    border: 0;
    height: 2px;
    background-image: 
        linear-gradient(to right, goldenrod, red, yellow);
    border-radius: 2px;
}

hr.transparent {
    border: 0;
    height: 1px;
    
    background-image: linear-gradient(to right, 
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0.75), 
        rgba(0, 0, 0, 0)
    );
}

hr.dashed {
    border: 0;
    border-bottom: 1px dashed #ccc;
    background: #999;
}

hr.solid {

    /* ⭐️ 如果要使用 content-box 的背景色 */
    background-color: #999;
    height: 8px;                /* ⭐️ 要設定高度❗️ */

    border-style: none;         /* ⭐️ 關閉 border */
    border-radius: 4px;
}

hr.dotted {

    /* ⭐️ 只開放 border-top */
    border-style: dotted none none;

    border-width: 8px;
    border-color: #999;
    width: 100px;
}


hr.thin {
    border: 0;
    height: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

hr.height {
    height: 12px;
}

hr.left {
    margin-right: 50%;
}

hr.right {
    margin-left: 50%;
}

hr.border0 {
    border: 0;
}

hr.bg {
    background-color: #eee;
}

hr.shadow {
    box-shadow: var(--x) var(--x) var(--x) 0px #888888 inset;
}
```

{% endtab %}

{% tab title="🗺️ 圖表" %}
{% embed url="<https://codepen.io/lochiwei/pen/vYmoWOw>" %}

{% embed url="<https://replit.com/@pegasusroe/style-lesshrgreater#index.html>" %}
{% endtab %}

{% tab title="📘 手冊" %}

* [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) ⟩ [Elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element) ⟩ [\<hr>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr)
* [htmlelement](https://lochiwei.gitbook.io/web/browser/dom/type/htmlelement "mention") ⟩ [HTMLHRElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHRElement)
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lochiwei.gitbook.io/web/html/element/hr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
