<detailsopen><summary>Click here</summary><p>These are the details</p></details>
And you just toggle the open attribute on the details element to open and close it. The arrow marker can be customized using the css pseudo element ::marker to set the color, font size, etc.
🇺🇦 Awesome front-end developer in SkillReveal, founder of LvivCSS conference, passionate HTML&CSS enthusiast.
Can argue about section vs div for hours.
The simplest accordion element is with pure html:
And you just toggle the
open
attribute on thedetails
element to open and close it. The arrow marker can be customized using the css pseudo element::marker
to set the color, font size, etc.Yet it is not transforming to tabs with CSS.
This is pure demo of CSS capabilities, not a practical guide to use in your projects.