Bootstrap Close Button - Creating close button in Bootstrap
Bootstrap Close Button
- It provide an option to dismiss or close a component with .btn-close. Default styling is limited, but highly customizable.
- Modify the Sass variables to replace the default background-image. Ensure to include text for screen readers, as we’ve done with aria-label.
Sample Code
Output
Bootstrap Disabled Close Button
- Disabled close buttons change their opacity. We’ve also applied pointer-events: none and user-select: none to preventing hover and active states from triggering.
Sample Code
Output
Bootstrap White Close Button
- Change the default .btn-close to be white with the .btn-close-white class. This class uses the filter property to invert the background-image.