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>
  <summary>Title</summary>
  <p>Here is the content that is open by default!</p>
</details>

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.

 



This article was written by David Hayes and originally published on WPShout.

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

You have to agree to the comment policy.

Show Your ❤️ Love! Like Us
Scroll to Top