HTML and CSS Reference
This extends the previous three formats to include an alpha (opacity) value. The alpha
value must be a real number between 0 and 1 inclusive; percentages are not permitted
for the alpha value. Thus, rgba(0,0,255,0.5) and rgba(0,0,100%,0.5) and
hsla(0,100%,50%,0.5) are equivalent half-opaque red. There is no hexadecimal notation
One of 17 recognized keywords based largely on the original Windows VGA colors. These
keywords are aqua , black , blue , fuchsia , gray , green , lime , maroon , navy , olive , or-
ange , purple , red , silver , teal , white , and yellow . Browsers generally also recognize
other keywords, such as the 147 X11 color keywords documented in section 4.3 of the
W3C CSS3 Color Module specification ( http://www.w3.org/TR/css3-color ). The CSS3
Color Module drops orange from the list of recognized basic keywords, but it appears in
the X11 list and all known browsers support it for historical reasons.
A special keyword that represents the current computed value of the element's color
property. This means that you could declare background-color: currentColor and set
the element's background the same color as its foreground (not recommended). When ap-
plied to the color property, it is equivalent to declaring color: inherit . It can also be
used on borders; border: 1px solid is equivalent to border: 1px solid currentCo-
lor . This can be quite useful when (un)setting a border's color via DOM scripting.
A special keyword that is a shorthand (just barely) for rgba(0,0,0,0) , which is the com-
puted value any time transparent is used.