Benutzer:Red Rooster/Schrott
Bild
Daten
How do you maen create an accordion?
<details>
and <summary>
natively.
What if I have to support IE11 or older browsers?
What type of content can I have inside one of these?
<details>
element allows all flow content, which is basically everything.
How does it work?
<details>
element encapsulates the <summary>
element. The <summary>
becomes the 'label' for the <details>
and acts like a button. When clicked, the attribute open
is added to the <details>
element, making it display. You can therefore style the open and closed states seperately if you'd like.