Accordions in Pure HTML

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.

Keep reading the article at WPShout. The article was originally written by David Hayes on 2022-02-16 13:02:48.

The article was hand-picked and curated for you by the Editorial Team of WP Archives.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

Your email address will not be published. Required fields are marked *

Show Your ❤️ Love! Like Us
Scroll to Top