From the course: Bootstrap 4 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create collapsible content

Create collapsible content - Bootstrap Tutorial

From the course: Bootstrap 4 Essential Training

Start my 1-month free trial

Create collapsible content

- Every so often, we need to create a navigation that collapses when the width of the device or the window is really small. That's because navigation can take up a lot of room vertically on a small device and often, we want to make sure that that room isn't taken over unless the user wants it. So in order to do that, we create these collapsible sections of content and to do that in Bootstrap, you essentially need two parts, the thing that you want to collapse and some element that will control that content. So we need to work on two different parts. For the collapsible content, you're going to need a couple of classes, the first one is the generic collapse class that goes on the content that you of course want to collapse. And in addition to that, you're also going to use another class called navbar collapse because most of the time when you're using this feature, you're going to be collapsing a navbar. Now there are some other things that you need to do and we need to tie the element…

Contents