You are here: >

HTML <details> tag

HTML details tagWhen writing in HTML, the <details> tag is a block element used to create an interactive widget in which content may be hidden. It is useful when you would like to include extra information without taking up space. The following sections contain information about this tag, including an example of it in use, as well as related attributes and browser compatibility.

Example code

<details>
<summary>Here is some information.</summary>
<p>Here are additional details about this information.</p>
</details>

Example result

Here is some information.

Here are additional details about this information.


Attributes

Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <details> tag, as well as a description of each.

Attribute Description
open Designates that the details should be open when the page first loads

Compatibility

Internet Explorer Firefox Safari Opera Chrome
Not supported Not supported 6.0+ 15.0+ 12.0+

Also see: Browser, Compatibility, Interactive, HTML summary tag