SyntaxStudy
Sign Up
Home HTML Reference <details> & <summary>

<details> & <summary>

tag HTML5

Creates a native accordion/disclosure widget. <summary> is the visible heading; content expands on click.

Syntax

<details>\n <summary>Click to expand</summary>\n <p>Hidden content</p>\n</details>

Example

html
<details>
    <summary>What is HTML?</summary>
    <p>HTML stands for HyperText Markup Language. It is the standard language for creating web pages.</p>
</details>
<details open>
    <summary>Is it free?</summary>
    <p>Yes, HTML is completely free and open standard.</p>
</details>