Context colors
Bootstrap defines nine context types to give the user a visual indicator of what type of information is being conveyed: primary, secondary, success,info,warning, danger, dark, light, and white as well as providing the developer with simple classes to assign context to elements via text color,text-<context>
, or background color,bg-<context>
. For elements containing text, Bootstrap also provides the muted context color.
The available classes are these:
text-muted
text-primary
andbg-primary
text-secondary
andbg-secondary
text-info
andbg-info
text-warning
andbg-warning
text-danger
andbg-danger
text-light
andbg-light
text-dark
andbg-dark
text-white
andbg-white
Bootstrap also provides a helper class for making an element transparent:
.bg-transparent { background-color: transparent !important; }
By defining focus
and hover
rules, Bootstrap ensures that links blend in nicely with the different backgrounds. Consider this example:
a.bg-danger:focus, a.bg-danger:hover { ...