Expand / Collapse Widget Demo

What is HTML?

HTML stands for HyperText Markup Language. It is the standard markup language for creating web pages and web applications. It provides the structure of a page using elements and tags.

How does the details/summary element work?

The details element creates a collapsible widget. The summary element is the clickable label that toggles the visibility of the rest of the content inside the details element.

Try another example

You can put any content inside the expanded area, including text, lists, images, or even other widgets. This approach uses semantic HTML to create accessible expand/collapse sections without JavaScript.