From the course: Bootstrap 5 Essential Training
Unlock this course with a free trial
Join today to access over 23,300 courses taught by industry experts.
Accordions - Bootstrap Tutorial
From the course: Bootstrap 5 Essential Training
Accordions
- [Instructor] One way to condense a lot of data in a small space is through the use of accordions. Now this is probably the hardest component to get working because there are so many things to wire together but let's go through it anyways. Right, so the accordion classes start by allowing you to create an accordion container. This is a main container class. It's going to need an ID to identify this accordion versus other accordions on the page. Inside the accordions you add an accordion item class for each item that you want to be part of this accordion. And inside those, you can include an accordion header and an accordion collapse as well. And sometimes in the accordion header you're going to want actually an accordion button, because that is going to be what turns the accordion on and off. The header, as well as the accordion collapse, they're going to both need an ID because the header is going to have a button that's going to turn on the accordion collapse and sometimes you need…