Overview
The background-color CSS property sets the background color of an element.
Colors
Use color please refer to Colors.
bg:fade-60bg:gray-60bg:brown-60bg:orange-60bg:gold-60bg:yellow-60bg:grass-60bg:green-60bg:beryl-60bg:teal-60bg:cyan-60bg:sky-60bg:blue-60bg:indigo-60bg:violet-60bg:purple-60bg:fuchsia-60bg:pink-60bg:crimson-60bg:red-60Hex
bg:#878d9fbg:#8d8d8fbg:#af836ebg:#d5731ebg:#c08000bg:#ac8a00bg:#689c13bg:#08a345bg:#00a170bg:#009f94bg:#0099c1bg:#0b92eebg:#538ceebg:#7d84e8bg:#9e77f5bg:#b56cecbg:#e04ee5bg:#ee52a3bg:#ea5b82bg:#eb5f63RGB
bg:rgb(135,141,159)bg:rgb(141,141,143)bg:rgb(175,131,110)bg:rgb(213,115,30)bg:rgb(192,128,0)bg:rgb(172,138,0)bg:rgb(104,156,19)bg:rgb(8,163,69)bg:rgb(0,161,112)bg:rgb(0,159,148)bg:rgb(0,153,193)bg:rgb(11,146,238)bg:rgb(83,140,238)bg:rgb(125,132,232)bg:rgb(158,119,245)bg:rgb(181,108,236)bg:rgb(224,78,229)bg:rgb(238,82,163)bg:rgb(234,91,130)bg:rgb(235,95,99)Applying with functions
<div class="background-color:$(value)">...</div>Master supports native CSS variables and functions, just add var(--key) or use shorthand$(key) for variables.
You can also use calc(expression), env(expression) and other CSS functions if the property supports it.
To learn more, see the Functions documentation.
Conditionally apply
States and selectors
<div class="background-color:fade-10:hover">...</div>Master supports all native CSS selectors, just add :hover, :disabled, chaining, combinators and other CSS selectors as usual.
To learn more, see the Selectors documentation.
Responsive breakpoints
<div class="background-color:fade-10@sm">...</div>Responsive breakpoints can be applied to all styles. Some available breakpoints are 3xs, 2xs, xs, sm,md, lg, xl, 2xl, 3xl, 4xl. Arbitrary breakpoints can be specified through comparison operators >, >=, <, <=.
To learn more, see the Breakpoints documentation.
Print format and media queries
<div class="background-color:fade-10@print">...</div>Master supports media types like print, screen, speech, all, and other media queries.
To learn more, see the Media Queries documentation.
Dark mode and color schemes
<div class="background-color:fade-10@dark">...</div>Master uses the selector html.dark to support color schemes. Now, you can easily fine-tune your style for the color schemes.
To learn more, see the Color Schemes documentation.