Close button
A generic close button for dismissing content like modals and alerts.
Close Button on BootstrapExample
Be sure to include text for screen readers, as we’ve done with aria-label
. Disabled close buttons have pointer-events: none
and user-select: none
applied to, preventing hover and active states from triggering.
<button class="btn-close" type="button" aria-label="Close"></button><button class="btn-close" type="button" disabled="" aria-label="Close"></button>
White variant
Change the default .btn-close
to be white with the .btn-close-white
class. This class uses the backdrop-filter
property to invert the background-image.
<div class="bg-1000 rounded p-3"><button class="btn-close btn-close-white" type="button" aria-label="Close"></button><button class="btn-close btn-close-white" type="button" disabled="" aria-label="Close"></button></div>