My projects use Bootstrap and most of the time without any Javascript because I only need the styling. Now I have a project that needs something like their Accordion which needs Javascript to work. However there is a standard <details>
HTML tag that can do that. The problem is I cannot really apply Accordion styling to it.
This is my best attempt so far but the accordion-header
simply wraps all the body as well:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="accordion">
<details class="accordion-item">
<summary class="">
<div class="accordion-header">
Title
</div>
</summary>
<div class="accordion-body">
<p>This is the body</p>
</div>
</details>
</div>
An alternative would be somehow making the summary
look like an .alert
.