Follow the steps in this blogpost. I basically copied and modified some code from 2-3 sources, all are mentioned in the blogpost. Reply below or DM on twitter if this was helpful :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="preconnect" href="https://fonts.googleapis.com"> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
<link href="https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet"> | |
<h1>Using the <span><details></span> tag to create tabs</h1> | |
<div class="details-tabs"> | |
<details class="details-item" open> <!-- default first "tab" to open --> | |
<summary class="details-tab">The details tag</summary> | |
<div class="details-content"> | |
<p>Imagine an <strong>accordion-like element</strong> with <strong>native keyboard support</strong> that doesn't require javascript for control.</p> | |
<p>Enter the details tag.</p> |