Which property is used to change the background color?

  1. color:

  2. bgcolor:

  3. background-color:

  4. None of the above


Correct Option: C

AI Explanation

To answer this question, you need to understand CSS (Cascading Style Sheets) properties.

The correct answer is C) background-color.

Explanation:

A) color: This property is used to change the text color, not the background color.

B) bgcolor: This property was used in older versions of HTML to change the background color, but it is no longer supported in modern web development.

C) background-color: This property is used to change the background color of an element. It allows you to specify a color using various formats such as named colors (e.g., "red", "blue"), hexadecimal values (e.g., "#FF0000", "#0000FF"), RGB values (e.g., "rgb(255, 0, 0)", "rgb(0, 0, 255)"), or HSL values (e.g., "hsl(0, 100%, 50%)", "hsl(240, 100%, 50%)").

D) None of the above: This option is incorrect because the correct answer is C) background-color.

Therefore, the correct answer is C) background-color. This option is correct because it is the CSS property used to change the background color of an element.

Find more quizzes: