Web Authoring WEBJX Article Description: Using the new CSS3 "RGBA" declaration not only allows us to set the RGB color as usual, but also to set its transparency. Using the new CSS3 "RGBA" declaration not only allows us to set the RGB color as usual, but also to set its transparency.
Using the new CSS3 "RGBA" declaration not only allows us to set the RGB color as usual, but also to set its transparency.
Using the new CSS3 "RGBA" declaration not only allows us to set the RGB color as usual, but also to set its transparency.
Previous post: CSS3 Tutorial (8): CSS3 Transparency Guide
RGBA sets the color like RGB, and the last value in this "A"--rgba-allows us to set the transparency of the element. Just like the opacity declaration, an element with a opacity value of 1 is completely opaque, and an element with a opacity of 0 is completely transparent.
Browser Compatibility
RGBA now has better support in Firefox, Google Chrome, and Safari, without the need for a prefix. CSS3 RGBA Color
The above effects are implemented in the following styles:
P.rgbal1 {Background:rgba (153, 134, 117, 0.2); height:20px;} P.rgbal2 {Background:rgba (153, 134, 117, 0.4); height:20px;} P.rgbal3 {Background:rgba (153, 134, 117, 0.6); height:20px;} P.rgbal4 {Background:rgba (153, 134, 117, 0.8); height:20px;} P.RGBAL5 {Background:rgba (153, 134, 117, 1.0); height:20px;}
Browser Support
Firefox (3.05 ...)
Google Chrome (1.0.154 ...)
Google Chrome (2.0.156 ...)
Internet Explorer (IE7, IE8 RC1)
Opera (9.6 ...)
Safari (3.2.1 windows ...)