This template demonstrates the most commonly used CSS background properties with examples. Each section covers a key property, its possible values, and a visual example.
background-colorSets the background color of an element, e.g., red, #ff0000, rgba(0, 255, 0, 0.5).
background-imageSets a background image, e.g., url('image.jpg'), linear-gradient(...).
background-repeatControls how a background image repeats, e.g., repeat, no-repeat, repeat-x, repeat-y.
background-positionSets the position of a background image, e.g., center, top left, 50% 50%.
background-sizeSets the size of a background image, e.g., auto, cover, contain, 100px 100px.
background-attachmentControls whether a background image scrolls or is fixed, e.g., scroll, fixed, local.
background-clipDefines how far the background extends, e.g., border-box, padding-box, content-box.
backgroundShorthand for all background properties, e.g., #fff url('image.jpg') no-repeat center/cover.