我們的志工尚未將此文章翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
The HTML <details> element is used as a disclosure widget from which the user can retrieve additional information.
| Content categories | Flow content, sectioning root, interactive content, palpable content. |
|---|---|
| Permitted content | One <summary> element followed by flow content. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parent elements | Any element that accepts flow content. |
| DOM interface | HTMLDetailsElement |
Attributes
This element includes the global attributes.
open- This Boolean attribute indicates whether the details will be shown to the user on page load. Default is
falseand so details will be hidden.
Example
<details> <summary>Some details</summary> <p>More info about the details.</p> </details>
Live result
Note: If the live sample above doesn't work for you, see Browser compatibility to determine if your browser supports the feature at all.
Specifications
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard The definition of '<details>' in that specification. |
Living Standard | |
| HTML5.1 The definition of '<details>' in that specification. |
Working Draft | Initial definition |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | MS Edge | Opera | Safari |
|---|---|---|---|---|---|---|
| Basic support | 12 | 49.0 (49.0)[1] | No support | Under consideration | 15 | 6 |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | 4.0 | 49.0 (49.0)[1] | No support | No support | No support |
[1] This feature is available since Firefox 47 behind the preference dom.details_element.enabled, defaulting to false, except on Nightly and Aurora versions (bug 1241750). Support for it is enabled by default, i.e. the preference is defaulting to true, since Firefox 49.0 (bug 1226455).
See also
文件標籤與貢獻者
標籤:
此頁面的貢獻者:
SphinxKnight,
user31782,
suttlecommakevin,
Sebastianz,
Mardeg,
teoli,
slimsag,
Poetro,
Sheppy,
Jeremie,
dhodder,
TheShrew,
Aslam.Sayyed,
vtsatskin,
kscarfone,
ethertank,
tregagnon,
niaher,
medicdude,
AskMP,
McGurk,
ebidel,
timemachine3030,
cers,
fscholz,
hobophobe
最近更新:
SphinxKnight,