mirror of
				https://github.com/twbs/bootstrap.git
				synced 2025-11-04 00:03:15 -05:00 
			
		
		
		
	
		
			
				
	
	
	
		
			1.3 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.3 KiB
		
	
	
	
	
	
	
	
| layout | title | description | group | toc | 
|---|---|---|---|---|
| docs | Close button | A generic close button for dismissing content like modals and alerts. | components | true | 
Example
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. Be sure to include text for screen readers, as we've done with aria-label.
{{< example >}} {{< /example >}}
Disabled state
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.
{{< example >}} {{< /example >}}
White variant
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.
{{< example class="bg-dark" >}} {{< /example >}}
Sass
Variables
{{< scss-docs name="close-variables" file="scss/_variables.scss" >}}