1D0-720 · Question #91
Which CSS property is used to change the text color of an element?
The correct answer is A. color. color is the correct CSS property for setting text color - for example, color: red; or color: #ff0000; applied to any element changes its foreground text. The other options are invented properties that do not exist in CSS: font-color sounds plausible but CSS uses font-*…
Question
Which CSS property is used to change the text color of an element?
Options
- Acolor
- Btext-style
- Cfont-color
- Dtext-color
How the community answered
(65 responses)- A94% (61)
- B3% (2)
- C2% (1)
- D2% (1)
Explanation
color is the correct CSS property for setting text color - for example, color: red; or color: #ff0000; applied to any element changes its foreground text. The other options are invented properties that do not exist in CSS: font-color sounds plausible but CSS uses font-* properties only for typography attributes like size, weight, and family, not color. text-color and text-style are similarly non-existent - CSS does have text-decoration and text-transform, but no text-color or text-style. A handy memory tip: think of color as the "pen color" - it's the one property that directly controls what color the ink (text) appears in, kept deliberately short because it's one of the most frequently used properties in CSS.
Topics
Community Discussion
No community discussion yet for this question.