24.7k views
4 votes
What command would you use to change the background color to blue?

1) background-color: blue;
2) color: blue;
3) text-color: blue;
4) font-color: blue;

1 Answer

1 vote

Final answer:

The correct command to change the background color to blue in CSS is 'background-color: blue;'. This property specifically changes the background of an element, unlike 'color', which changes text color.

Step-by-step explanation:

The correct command to change the background color to blue is background-color: blue;. This command is used within CSS (Cascading Style Sheets) to alter the background color of an HTML element. The syntax consists of the property background-color, followed by a colon, and then the color value which can be a color name, like blue, hexadecimal code, RGB, RGBA, HSL, or HSLA value.

Option 1) background-color: blue; is the correct choice because it directly modifies the background color of an element. Option 2) color: blue; changes the text color, not the background. Options 3) and 4) are incorrect as there are no 'text-color' or 'font-color' properties in CSS.

User Mika Vatanen
by
7.6k points

No related questions found