The color property sets the color of an element’s foreground content (usually text), accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a).
Overview tableblack, except in a few cases (see notes)
color
color: color
p {color:turquoise}
p {color:#40E0D0}
p { color: rgb(64,224,208) }
p { color: rgb(25.1%,87.8%,81.6%) }
p { color: hsl(174,72%,56%) }
p { color: rgba(64,224,208,0.8) }
p { color: hsla(174,72%,56%,0.8) }
Usage
Though CSS color values are precisely defined, they may appear differently between different output devices. Most of them are not calibrated, and some browsers do not support output device color profiles. Without these, color rendering may vary significantly.
Notes Default color
Some browsers change the default color from black to another color in their default css (user-agent stylesheet).
RGB, HSL, RGBa and HSLa supportHSL, RGBa and HSLa are not supported by older browsers (IE6-8), therefore if you do use such colours you should also provide a fallback color property that uses something similar but more widely supported, like a hex value. This should be placed either next to the modern color value but earlier in the cascade, or in a separate stylesheet hidden behind a conditional comment.
Separating foreground from backgroundIn order to make it easier for users to see and hear content including separating foreground from background, [WCAG] indicates the following:
See css color value for more information. The color value may be given as:
aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow
aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, ...
- RGB
#00f
#0000ff
rgb(0,0,255)
rgb(0%,0%,100%)
rgba(0,0,255,0.5)
rgba(0%,0%,100%,0.5)
hsl(0, 100%, 50%)
hsla(0, 100%, 50%, 0.5)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4