Q1. What does background-color property do?
background-color sets the background color of an element. It can use any valid color format.
Q2. Can background-color be applied to any element?
Yes, background-color can be applied to any HTML element, including block, inline, and inline-block elements.
Q3. What is the default value of background-color?
The default value is transparent, allowing parent backgrounds to show through.
Q4. How do you set a semi-transparent background?
Use RGBA or HSLA colors: background-color: rgba(255,0,0,0.5); for 50% transparent red.
Q5. What is the difference between background-color and background?
background is a shorthand property that can set multiple background properties at once, including color, image, position, and repeat.
