HTML <details> tag
Updated: 11/13/2018 by Computer Hope
When writing in HTML (hypertext markup language), the <details> tag is a block element used to create an interactive widget where content may be hidden. It is useful when you want to include extra information without taking up space. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.
Example of <details> code
<details>
<summary>Information summary example.</summary>
<p>Here are additional details about this information.</p>
</details>
Example result
Information summary example.
Here are additional details about this information.
Attributes
All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <details> tag has the following unique attributes.
Attribute | Description |
---|---|
open | Designates that the details should be open when the page first loads. |
Compatibility
Edge | Internet Explorer | Firefox | Safari | Opera | Chrome |
---|---|---|---|---|---|
Not supported | Not supported | Not supported | 6.0+ | 15.0+ | 12.0+ |
Browser, Compatibility, Container tag, HTML summary tag, Interactive, Web design terms