Multiple choice technology web technology

How do you change the text color of an element?

  1. text-color:

  2. color:

  3. text-color=

  4. fgcolor:

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

The color CSS property is used to change the text color (foreground color) of an element. There is no text-color or fgcolor property in CSS. The property name is simply color, applied to the text content of the element.

AI explanation

To change the text color of an element, you can use the CSS property called "color".

The correct answer is B) color.

Explanation for each option:

Option A) text-color: This option is incorrect because there is no CSS property called "text-color". The correct property to change the text color is "color".

Option B) color: This option is correct. The "color" property is used to change the text color of an element. You can specify the color value using various formats such as color names (e.g., "red", "blue"), hexadecimal codes (e.g., "#FF0000"), or RGB/RGBA values (e.g., "rgb(255, 0, 0)", "rgba(255, 0, 0, 0.5)").

Option C) text-color=: This option is incorrect because the correct syntax for the "color" property does not include an equals sign (=). The correct syntax is "color: value;".

Option D) fgcolor: This option is incorrect because there is no CSS property called "fgcolor". The correct property to change the text color is "color".

Therefore, the correct answer is B) color.