Set the text-color for different elements:
The color property sets or returns the color of the text.
The color property is supported in all major browsers.
Return the color property:
Set the color property:
Value | Description |
---|---|
color | Specifies the color of the text. Look at CSS Color Values for a complete list of possible color values |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | not specified |
---|---|
Return Value: | A String, representing the text-color of an element |
CSS Version | CSS1 |
Return the text-color of a <p> element:
CSS tutorial: CSS Text
CSS reference: color property