HTML and CSS Reference
In-Depth Information
CSS3 Color
Feature
Description
Example(s)
Support
HSLa Color
CSS3 HSL value with a
fourth value to set the
alpha channel value for the
color to define the opacity
of the element. An HSLa is
specified via a function style
hsla(
hue,saturation,
lightness, alpha)
,
where hue, saturation, and
lightness are the same as
standard
hsl()
values, and
the alpha channel value for
defining opacity is a number
between 0 (fully transparent)
and 1 (fully opaque).
#bluetrans {
color:
hsla(240,100%,50%,0.5);}
Firefox 3+,
Safari 3+,
Chrome 1+,
Opera 10+
RGBa Color
Like RGB color but adds
an alpha channel value
to specify the opacity
of the color. An RGBa is
specified via a function style
rgba(r,g,b,a)
value,
where colors r, g, and b
are specified as a decimal
value from 0 to 255 or a
percentage from 0 to 100%,
and the alpha channel
value for defining opacity is
a number between 0 (fully
transparent) and 1 (fully
opaque). Values outside this
range will be rounded up or
down to fit the closest value.
#redtrans {
color: rgba(255,0,0,0.4);}
Firefox 3+,
Safari 3+,
Chrome 1+,
Opera 10+
transparent
keyword
CSS3 defines the
color
property to accept the
keyword
transparent
,
which is just a shorthand for
a value of
rgba(0,0,0,0)
.
<p style=
"
color:
transparent;
"
>
When working
seems invisible
</p>
Firefox 3.5+,
Opera 10+,
Chrome 1+
T
ABLE
6-5 New CSS3 Color Units (continued)