HTML and CSS Reference
In-Depth Information
Name
color
Values:
<color>
Initial value:
User agent-specific
Applies to:
All elements
Inherited:
Yes
Computed value:
See description
Description:
Defines the foreground color of an element, which in HTML rendering means the text of an
element; raster images are not affected by
color
. This is also the color applied to any borders
of the element, unless overridden by
border-color
or one of the other border color proper-
ties (
border-top-color
, etc.).
In the case of color keywords (such as
navy
) and RGB hex values (such as
#008800
or
#080
), the computed value is the
rgb()
equivalent. For
transparent
, the computed value is
rgba(0,0,0,0)
; for
currentColor
, the computed value is
inherit
. For all other values, the
computed value is the same as the declared value.
Examples:
strong {color: rgb(255,128,128);}
h3 {color: navy;}
p.warning {color: #ff0000;}
pre.pastoral {color: rgba(0%,100%,0%,0.33334);}