Complete the code to create a button that toggles a horizontal collapse.
<button class="btn btn-primary" type="button" data-bs-toggle="[1]" data-bs-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> Toggle Width Collapse </button>
The data-bs-toggle="collapse" attribute tells Bootstrap to toggle the collapse behavior on the target element.
Complete the code to make the collapsible content expand horizontally.
<div class="collapse [1]" id="collapseExample"> <div class="card card-body"> This content collapses horizontally. </div> </div>
The class collapse-horizontal makes the collapse expand and collapse horizontally instead of vertically.
Fix the error in the button code to properly toggle horizontal collapse.
<button class="btn btn-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#[1]" aria-expanded="false" aria-controls="collapseWidthExample"> Toggle Width Collapse </button>
The data-bs-target must exactly match the ID of the collapsible element, which is collapseWidthExample.
Fill both blanks to create a horizontal collapse with a button that toggles it.
<button class="btn btn-info" type="button" data-bs-toggle="[1]" data-bs-target="#collapseWidthExample" aria-expanded="false" aria-controls="collapseWidthExample"> Toggle Width Collapse </button> <div class="collapse [2]" id="collapseWidthExample"> <div class="card card-body" style="width: 300px;"> This is some placeholder content for a horizontal collapse. </div> </div>
The button must toggle collapse, and the collapsible div must have the collapse-horizontal class to collapse horizontally.
Fill all three blanks to create a horizontal collapse with a button and set the width style.
<button class="btn btn-warning" type="button" data-bs-toggle="[1]" data-bs-target="#collapseWidthExample" aria-expanded="false" aria-controls="collapseWidthExample"> Toggle Width Collapse </button> <div class="collapse [2]" id="collapseWidthExample"> <div class="card card-body" style="width: [3];"> This is some placeholder content for a horizontal collapse. </div> </div>
The button toggles collapse, the div uses collapse-horizontal for horizontal effect, and the width is set to 300px for visible horizontal size.