HTML and CSS Certification Practice Test

Question: 1 / 400

Which property is used to change the text color in CSS?

font-color

text-color

color

The property used to change the text color in CSS is "color." This property directly affects the color of the text content within an element. When you assign a color value to the "color" property, it determines how the text is displayed on the screen. This is fundamental in styling webpages, allowing for visual contrast and improved readability.

For instance, using a rule like `color: red;` will apply a red hue to the text of the selected element. This property supports various color formats, including named colors, hexadecimal values, RGB, and RGBA, providing flexibility in design choices.

In contrast, the terms "font-color" and "text-color" do not exist in standard CSS. They might seem intuitive but are not recognized properties, so they would not yield any effect on text color in a stylesheet. Meanwhile, "background-color" controls the background color of an element rather than the text itself, which reinforces the importance of using the correct property for the desired effect.

Get further explanation with Examzify DeepDiveBeta

background-color

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy