Baseline Widely available *
The HTML Disclosure Summary element (<summary>
) element specifies a summary, caption, or legend for a <details>
element's disclosure box. Clicking the <summary>
element toggles the state of the parent <details>
element open and closed.
<details>
<summary>
I have keys but no doors. I have space but no room. You can enter but canât
leave. What am I?
</summary>
A keyboard.
</details>
details {
border: 1px solid #aaa;
border-radius: 4px;
padding: 0.5em 0.5em 0;
}
summary {
font-weight: bold;
margin: -0.5em -0.5em 0;
padding: 0.5em;
}
details[open] {
padding: 0.5em;
}
details[open] summary {
border-bottom: 1px solid #aaa;
margin-bottom: 0.5em;
}
ÐÑÑибÑÑÑ
ÐÑÐ¾Ñ ÑÐ»ÐµÐ¼ÐµÐ½Ñ Ð²ÐºÐ»ÑÑÐ°ÐµÑ ÑолÑко глобалÑнÑе аÑÑибÑÑÑ.
ÐÑимеÑаниÑСодеÑжимÑм ÑлеменÑа <summary>
Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð»Ñбой заголовок, пÑоÑÑой ÑекÑÑ Ð¸Ð»Ð¸ HTML, коÑоÑÑе можно иÑполÑзоваÑÑ Ð² абзаÑе.
ÐÐ»ÐµÐ¼ÐµÐ½Ñ <summary>
Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¸ÑполÑзован в каÑеÑÑве поÑомка ÑлеменÑа <details>
. Ðогда полÑзоваÑÐµÐ»Ñ ÐºÐ»Ð¸ÐºÐ°ÐµÑ Ð¿Ð¾ ÑлеменÑÑ summary, его ÑодиÑÐµÐ»Ñ - <details>
менÑÐµÑ ÑоÑÑоÑние Ñ ÑаÑкÑÑÑого или закÑÑÑого на обÑаÑное,и Ñогда toggle
event is sent to the <details>
element, which can be used to let you know when this state change occurs.
If a <details>
element's first child is not a <summary>
element, the user agent will use a default string (typically "Details") as the label for the disclosure box.
Per the HTML specification, the default style for <summary>
elements includes display: list-item
. This makes it possible to change or remove the icon displayed as the disclosure widget next to the label from the default, which is typically a triangle.
You can also change the style to display: block
to remove the disclosure triangle.
See the Browser compatibility section for details, as not all browsers support full functionality of this element yet.
ÐÑимеÑÑBelow are some examples showing <summary>
in use. You can find more examples in the documentation for the <details>
element.
A simple example showing the use of <summary>
in a <details>
element:
<details open>
<summary>Overview</summary>
<ol>
<li>Cash on hand: $500.00</li>
<li>Current invoice: $75.30</li>
<li>Due date: 5/6/19</li>
</ol>
</details>
Summaries as headings
You can use heading elements in <summary>
, like this:
<details open>
<summary><h4>Overview</h4></summary>
<ol>
<li>Cash on hand: $500.00</li>
<li>Current invoice: $75.30</li>
<li>Due date: 5/6/19</li>
</ol>
</details>
This currently has some spacing issues that could be addressed using CSS.
HTML in summariesThis example adds some semantics to the <summary>
element to indicate the label as important:
<details open>
<summary><strong>Overview</strong></summary>
<ol>
<li>Cash on hand: $500.00</li>
<li>Current invoice: $75.30</li>
<li>Due date: 5/6/19</li>
</ol>
</details>
СпеÑиÑикаÑии СовмеÑÑимоÑÑÑ Ñ Ð±ÑаÑзеÑами СмоÑÑиÑе Ñакже
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4