CSS color property.
➔ The color property determines the color of the text in an element.
Syntax
color: color | initial | inherit;
Property values
| Value | Description |
|---|---|
| color | Sets the text color. |
| initial | Sets the property to its default value. |
| inherit | The element inherits the property value from its parent element. |
Click on the "Try it Now" button to see how it works.
Sample Code
Copy each file contents and paste it to your own project and run to see the final output
Example
body {
background-color: #d4d4d4;
color: #2626d1;
}
h1 {
background-color: #000000;
color: #ffffff;
}
div {
background-color: #0000ff;
color: #ffffff;
}
Click on the "Try it Now" button to see how it works.