property

CSS color

Controls text foreground and supplies the currentColor reference. It inherits, so a parent color can reach descendants without another declaration. Pair foreground and background choices to maintain readable contrast.

Formal Syntax & Structure

css syntaxcss
color = <color>

Parameters & Attributes

NameTypeDescription
color<color>A supported CSS color value.

Working Example

Example Snippetcss
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>CSS reference demo</title><style>#sample { color: #184168; background-color: white; }</style></head><body><p id="sample">Field <span id="child">note</span></p></body></html>
CSS Reference