
CSS3: rgba color values!
January 14th 2010
RGBA actually stands for (R)ed (G)reen (B)lue (A)lpha and is used to define colors in your CSS. As you must already know, colors are composed of various amounts of red, green and blue to form the final color. In CSS you can now specify the opacity of the desired color, that’s what the alpha channel is for.
What does that mean?
Up until now, the only way we had to add opacity to an element was to use the opacity CSS property. While it’s working totally fine, the opacity is also applied to all the children of that element, so this solution is not really appropriate if you just want a transparent background on a container.
Take a look at the following demo page to see how RGBA and opacity reacts differently.
Another way would be to use transparent PNGs and use them as background images to achieve the desired effect, but then again it’s not the clean way of doing this and PNG support in IE6 is far from being good.
Now you can simply add opacity to the color of your background by defining the background color like so:
#container { background: rgba(255,0,0,0.2); }
The values are the following:
- Red color value
- Green color value
- Blue color value
- Alpha value, from 0 (transparent) to 1 (opaque).
Real world usage
As always with CSS3, you need to be careful on how you use it. If opacity on an element is not a major aspect of your design but a nice to have, you can consider RGBA. If your design rely on opacity to look nice, then you’ll have to look at other solutions.
What about degradation?
As you might expect, RGBA is not supported in any current version of Internet Explorer but it’s working as intended in the lastests versions of Chrome, Firefox, Safari, Opera, etc. To ensure at least everyone is able to see a solid background color, you must declare the properties as follow:
#container { background: rgb(255,0,0); /* For IE and older browsers */ background: rgba(255,0,0,0.2); }
So when a browser sees the first value, it’ll apply it to the element, if it supports RGBA, it’ll override the first declaration with the second one. This way you’re sure everyone will at least see a solid background.
Awesome! Its truly remarkable post, I have
got much clear idea regarding from this paragraph. https://www.google.co.uk/?gfe_rd=cr&ei=PclWWPKPKuvR8gefqYzgAg&gws_rd=ssl
Also, like I’ve mentioned in this article AdSense earnings relies upon upon the category of your web site and source of site visitors.
They pull the bes watches to the company’s customers.
German watchibg companies generation really unique dive timepieces.
Cartier Price tag waqtches happen to be popular. http://acetian.com/groups/mechanical-views-currently-the-magic-together-with-mystique/
Com esse tempo todo de pesquisas, eu adquirir inúmeras experiências, a cada dia tenho mais conhecimento de como trabalhar e ganhar dinheiro honestamente pela
internet.
Tenha um claro fazendário – possuimos muitos exemplos tais quais: viagens, confirmar uma aposentação, cursos –
e a abalar lhe desenvolva qualquer estratégia com investimento, lembrando-se toda vez compaixão respectivo delineamento
desde investidor. http://inb123.s17.xrea.com/sky/sky.cgi
Já se encontra disponível último exemplar da publicação Terapia Sexual
2012, para análise gratuíta na rede. http://Forestdancer58.Full-Design.com/-Em-Pratos-Limpos-3784576
I studying %BT%. Along with I`ve already been planning on taking our Instagram homepage facts about this item, you recognize, in the form of blog.
Are you able to help me to?
I savour, result in I found just what I was looking for.
You have ended my 4 day long hunt! God Bless you man. Have a great day.
Bye
So if you acquired stuck, are just starting or you’re just looking for to enhance your computer
game, look into our Island Experiment cheats and also ideas below in addition to have a good time!
Great post.
Cyrus, nevertheless, says she’s healthier than ever before after
embracing a pilates-inspired workout and a new diet routine to get her prepared for
the altar.
this is a good website, http://bingobashchips.online/ thanks
OKUMA, S. S. antigo bem como a exercício física. https://fuckthefad.com/qtoa/index.php?qa=68026&qa_1=22-dicas-para-abrigar-as-moda-por-melhor-tempo
The sharing of rgba color values is great. I have learned more about the “rgba color value”. The information you share is very reliable. Thanks for sharing.
The sharing of rgba color values is great. I have learned more about the “rgba color value”. The information you share is very reliable. Thanks for sharing.
So if you acquired stuck, are just starting or you’re just looking for to enhance your computer
Com esse tempo todo de pesquisas, eu adquirir inúmeras experiências, a cada dia tenho mais conhecimento de como trabalhar e ganhar dinheiro honestamente pela
Com esse tempo todo de pesquisas, eu adquirir inúmeras experiências, a cada dia tenho mais conhecimento de como trabalhar e ganhar dinheiro honestamente pela
Com esse tempo todo de pesquisas, eu adquirir inúmeras experiências, a cada dia tenho mais conhecimento de como trabalhar e ganhar dinheiro honestamente pela
“OKUMA, S. S. antigo bem como a exercício física. ”
eu adquirir inúmeras experiências, a cada dia tenho mais conhecimento de como trabalhar e ganhar dinheiro
Fastidious replies in return of this issue with real arguments and explaining the whole thing concerning that.
I’m very pleased to discover this page. I wanted to thank you for ones
time for this particularly wonderful read!! I definitely savored every little bit
of it and i also have you book marked to see new things in your site.
I got this web site from my friend who told me on the topic of this site and at the moment this time I am
browsing this web page and reading very informative articles or reviews here.
wow, awesome article.Thanks Again. Great.
RGBA color values are an extension of RGB color values with an alpha channel – which specifies the opacity for a color. An RGBA color value is specified with: rgba(red, green, blue, alpha).
There are many people looking for articles like this one. I have received quite a bit of information from this article.