- Home / CSS3 Previews / HSLA Colors
HSLA Colors
As RGBA is to RGB, HSLA is to HSL; that is, it allows a fourth value, which sets the Opacity (via the Alpha channel) of the element.
At the time of writing, only Safari 3 and the Firefox 3 beta support the HSLA style of color declaration.
An example:
The top row (if you are one of the few brave souls who have downloaded the Firefox 3 beta you can see it) uses the HSLA declaration;
<div style="background-color: hsla(0,100%,50%,0.2);"></div> <div style="background-color: hsla(0,100%,50%,0.4);"></div> <div style="background-color: hsla(0,100%,50%,0.6);"></div> <div style="background-color: hsla(0,100%,50%,0.8);"></div> <div style="background-color: hsla(0,100%,50%,1);"></div>
The second row approximates the output using RGB.
<div style="background-color: rgb(243,191,189);"></div> <div style="background-color: rgb(246,143,142);"></div> <div style="background-color: rgb(249,95,94);"></div> <div style="background-color: rgb(252,47,47);"></div> <div style="background-color: rgb(255,0,0);"></div>
A fuller explanation of HSLA colors can be found in the W3C CSS3 Color Candidate Recommendation.
TAG CLOUD
acid3
advanced layout
advanced layout module
background
border
Browsers
color
css
CSS3.info
csswg
CSS WG
developer tools
disabled
enabled
Feedback
firefox
firefox 3.1
flexible box layout
fonts
generated content
grid positioning
HSLA
HTML5
ie6
ie7
jina bolton
jquery
media player
Multicolumn Layout
News
Opera
Opera Dragonfly
presentations
RGBA
safari
Selectors
slides
SVG
text rendering
W3C
wasp
Web Fonts
webkit
windows
