VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-close-button-white-variant/

⇱ Bootstrap 5 Close button White variant - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Close button White variant

Last Updated : 23 Jul, 2025

Bootstrap 5 Close button is used to add more user access and enhance user experience to a website and its components. Generally, the default version of this button is dark/black and it goes universally with all the colors except the dark/black colored background or component which goes well and looks distinctive over this dark or black background. 

Bootstrap 5 Close button white variant Class:

  • btn-close-white: This class is used to indicate that the close button is supposed to be white.

Bootstrap 5 Close button white variant used attributes:

  • disabled(optional): This attribute is optional and if added to the close button, the button is disabled and it doesn't work anymore.

Syntax:

<button type="button" class="btn-close btn-close-white">
...
</button>

Example 1: The code example below demonstrates a dismissing alert which is in dark color with a white close button.

Output:

Example 2: The code example below demonstrates a simple modal which is in dark color with a white close button:

Output:

Reference:https://getbootstrap.com/docs/5.0/components/close-button/#white-variant

Comment

Explore