CSS3 RGBA Colors Usage Instructions

Source: Internet
Author: User
Tags object range

RGBA is an extension of the original RGB, which adds the fourth parameter: alpha channel. The alpha channel argument takes a decimal number between 0 and 1, just like opacity. The advantage of using RGBA instead of opacity is that when you use RGBA, transparency is not applied to child elements. This is also the one where you can use a completely opaque child object within a transparent object, and when you use opacity, the child elements of the transparent object are transparent.

RGB color Mode (also translated as "red, green and blue", less use) is a color standard of industry, is through the red (R), Green (G), Blue (B) three color channels and their superposition to get a variety of colors, RGB is the representative of red, green, blue three channels of color, This standard contains almost all the colors that human vision can perceive, and is one of the most widely used color systems.

RGBA has more parameters to control alpha transparency based on RGB. Above R, G, b three parameters, positive integer value of the value range is: 0-255. The values of the percentages are: 0%-100%. Values that are out of range will be limited to their closest values. Not all browsers support the use of percent values. A parameter, the value is between 0~1, cannot be negative.

Compatible: Firefox 3.0.10 Chrome 2.0.x Opera 9.64 Safari 4 Firefox 3.5

Like the following code: div {Background:rgb (255,0,0);/* The old One/Background:rgba (255,0,0,0.5);/* The New one * *

So what to do in IE: please look at the following:

<!--[if ie]>
<style type= "Text/css" >
. color-block {  background:transparent;
Filter:progid:DXImageTransform.Microsoft.gradient (
startcolorstr= #99000050, endcolorstr= #99000050);
 zoom:1;  }
</style>
 <![ Endif]-->

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > < HTML xmlns= "http://www.w3.org/1999/xhtml" > <pead> <meta http-equiv= "Content-type" content=; Charset=utf-8 "/> <meta http-equiv= content-language" content= "Utf-8"/> <meta name= "robots" content= "all" /> <meta name= "Author" content= "TENCENT-ISRD"/> <meta name= "Copyright" content= "Tencent"/> <title >rgba colors</title> </pead> <body> <div style= "Background-color:rgba (0,0,0,0.5);" > A black background with an alpha value of 0.5 in Firefox's browser </div> </body> </ptml>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.