Nearby lessons
7 of 19🖼️ CSS Background Properties
🎨 What are CSS Background Properties?
CSS Background Properties let you control the appearance of an element's background, including color, images, positioning, repetition, and sizing. These properties help create visually rich layouts and user experiences.
📋 Background Color
The background-color property sets the background color of an element using a color name, HEX, RGB, RGBA, or HSL format.
🖼️ Background Image
The background-image property sets an image or gradient as the background of an element.
🔁 Background Repeat
The background-repeat property controls whether and how a background image is repeated.
📌 Background Attachment
The background-attachment property determines if the background scrolls with the content or stays fixed.
🎯 Background Position
The background-position property sets the starting position of a background image.
📏 Background Size
The background-size property defines the size of the background image.
📝 Background Shorthand
The background shorthand allows combining background properties in one line.