Home Tutorials HTML Tutorial Details and Summary
Details and Summary

Details and Summary


41. Details and Summary

The <details> element creates a disclosure widget, and <summary> provides the visible label. This is useful for FAQs and expandable information sections.

Syntax

<details>
    <summary>Title</summary>
    Hidden content
</details>

Example

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

Output

A collapsible section appears; clicking the summary expands or hides the content.
Example

🏋️ Test Yourself With Exercises

Take our quiz on Details and Summary to test your knowledge.

Browse Quizzes »