What is the CSS property used to change the text color of an element?
What is the CSS property used to change the text color of an element?
258
06-Jun-2023
Aryan Kumar
07-Jun-2023The CSS property used to change the text color of an element is color. The color property can be used to specify the color of text, borders, and backgrounds. The color can be specified using a variety of formats, including:
For example, the following CSS code would change the color of all paragraphs to red:
Code snippet
The following CSS code would change the color of all links to blue:
Code snippet
The following CSS code would change the background color of all divs to green:
Code snippet
The color property can be used to change the color of any element on a web page. It is a powerful tool that can be used to create visually appealing and engaging web pages.