Predefined colors in Bootstrap

There are classes that specify color. For example, bg-primary means primary color for background. As you see class consist from prefix bg and suffix primary. Prefix denotes an element on which color must be applied, and suffix denotes color.

Color can be applied to text, background, border, table and etc.

There are main colors suffixes:

  • primary
  • secondary
  • success
  • danger
  • warning
  • info
  • light
  • dark
  • black
  • white

text color

Code example

.text-primary

.text-secondary

.text-success

.text-danger

.text-warning

.text-info

.text-light

.text-dark

.text-body

.text-muted

.text-white

.text-black-50

.text-white-50

background color

By adding a bg-gradient class, a linear gradient is added as background image to the backgrounds. This gradient starts with a semi-transparent white which fades out to the bottom.

Code example
.bg-primary
.bg-secondary
.bg-success
.bg-danger
.bg-warning
.bg-info
.bg-light
.bg-dark
.bg-white
.bg-transparent
.bg-primary.bg-gradient
.bg-secondary.bg-gradient
.bg-success.bg-gradient
.bg-danger.bg-gradient
.bg-warning.bg-gradient
.bg-info.bg-gradient
.bg-light.bg-gradient
.bg-dark.bg-gradient
.bg-white.bg-gradient
.bg-transparent.bg-gradient