Multiple choice css

Which property is used to change the background color?

  1. bgcolor:

  2. background-color:

  3. color:

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The background-color property controls an element's background. The older HTML attribute bgcolor is deprecated, and color property controls text color, not background.

AI explanation

In CSS, background-color is the standard property used to set an element's background color (e.g., background-color: red;). "bgcolor" is an old HTML attribute (used directly on tags like `), not a CSS property, so it doesn't apply in a stylesheet context. "color:" sets the text (foreground) color, not the background. Since the question asks specifically for the *property* to change background color,background-color:` is correct.