Back to Docs

<details> & <summary>

Description

The <details> HTML element creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label must be provided using the child <summary> element. When clicked, it natively expands to show the nested content without requiring JavaScript.

Code Snippet

<h2>FAQ</h2>

<details>
    <summary>What is HTML?</summary>
    <p>HTML is the standard markup language for web pages.</p>
</details>

Static Live Preview

localhost/details-static.html
What is HTML?

HTML (HyperText Markup Language) is the standard markup language used to create and structure pages on the World Wide Web.

Interactive Playground

localhost/details-interactive.html