Bootstrap – Backgrounds


Bootstrap – Background



”;


This chapter discusses about the background color utility classes and the gradients that can be used with these classes.


Accessibility tip: Use of color to the background just provides a visual indication, and this will not be helpful to users of assistive technologies like screen readers. Make sure that the meaning is clear from the content itself.

Use alternative means to add clarity to the content using the .visually-hidden class.


Background color

Like the contextual color classes for text, you can apply any contextual class to set the background of an element. Keep in mind that background utilities do not affect color, therefore, certain situations may require the use of .text-* color utilities.

Let us see an example: