Accordions in Pure HTML

This post by Salma Alam-Naylor is pretty short, but it does teach something that I certainly didn’t know. That these days you can really count on HTML to some cool things. I, for one, had no idea that an expanding/collapsible accordion of content could be as simple as this:

<details open>
  <p>Here is the content that is open by default!</p>

Pretty cool. She explains a few more details of whats going on here (and how browser support works) but I’m impressed.

Add a Comment

Your email address will not be published.