Interview Question

What is background property?

background paints colors and image layers behind a box.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

The background shorthand sets multiple background layers and the background color. • A box can have several background images. • Each layer can set position, size, repeat, origin, and clipping behavior. • The background color is painted behind all image layers.

💡 Simple Example

.hero { background: linear-gradient(#0008, #0008), url(hero.jpg) center / cover; }

⚡ Quick Revision

background paints colors and image layers behind a box.