SyntaxStudy
Sign Up
Home Bootstrap Reference bg-* (backgrounds)

bg-* (backgrounds)

class

Apply theme background colors to any element.

Syntax

class="bg-primary bg-light bg-dark"

Example

html
<div class="bg-primary text-white p-3">Primary background</div>
<div class="bg-success text-white p-3">Success background</div>
<div class="bg-danger  text-white p-3">Danger background</div>
<div class="bg-warning text-dark  p-3">Warning background</div>
<div class="bg-light   text-dark  p-3">Light background</div>
<div class="bg-dark    text-white  p-3">Dark background</div>