Background colour
background-color property. It controls the colour of an element’s background. | CSS Shortcut class | Applied style |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Examples
Primary
bg-primary
This element uses the primary Government of Canada accent colour for its background.
<p class="bg-primary text-light">
This element uses the primary Government of Canada accent
colour for its background.
</p> Active
bg-active
This element uses the active background colour.
<p class="bg-active text-light">
This element uses the active background colour.
</p> Black
bg-black
This element uses the black background colour.
<p class="bg-black text-light">
This element uses the black background colour.
</p> Current
bg-current
This element uses the background colour based on the current colour property.
<div class="bg-current" style="color: var(--gcds-color-blue-750)">
<p class="text-light">
This element uses the background colour based on the
current colour property.
</p>
</div> Danger
bg-danger
This element uses the danger background colour.
<p class="bg-danger text-light">
This element uses the danger background colour.
</p> Dark
bg-dark
This element uses the dark background colour.
<p class="bg-dark text-light">
This element uses the dark background colour.
</p> Disabled
bg-disabled
This element uses the disabled background colour.
<p class="bg-disabled">
This element uses the disabled background colour.
</p> Inherit
bg-inherit
This element inherits its parent’s background colour.
<div class="bg-danger">
<p class="bg-inherit text-light">
This element inherits its parent’s background colour.
</p>
</div> Light
bg-light
This element uses the light background colour.
<p class="bg-light">
This element uses the light background colour.
</p> Transparent
bg-transparent
This element has a transparent background colour.
<p class="bg-transparent">
This element has a transparent background colour.
</p> White
bg-white
This element has a white background colour.
<div class="bg-dark">
<p class="bg-white">
This element has a white background colour.
</p>
</div> xs:> 480pxsm:> 640pxmd:> 768pxlg:> 1024pxxl:> 1280px
<div class="xs:bg-light ...">
...
</div> hoverfocus
<div class="hover:bg-light ...">
...
</div>