Skip to content

Backgrounds

Elevate CSS features three compound properties for setting or configuring the background of an element: bg-img, bg-color, and bg-attr. bg-img and bg-color are fairly self explainatory while bg-attr is a more advanced property that can be used to configure the characteristics of the background of an element.


Setting Backgrounds

PropertyExpected ValuesExample
bg-imgPassThroughToken (e.g., (url(https://example.com/image.jpg)) )bg-img:(url(https://example.com/image.jpg))
bg-colorColorToken (e.g., purple+1)bg-color:purple+1





Configuring Background Attributes

PropertyExpected ValuesExample
bg-sizecover,containbg-attr:cover
bg-repeatno-repeat, repeat-x, repeat-y, repeat, space, round, initial, revert, unset, revert-layerbg-attr:no-repeat
bg-positionleft-top, left-center, left-bottom, center-top, center, center-bottom, right-top, right-center, right-bottombg-attr:center
bg-attachscroll, fixed, localbg-attr:fixed
bg-clipborder, content, padding, textbg-attr:content
bg-originborder, content, paddingbg-attr:border