How To, Get great looking Transparencies with RGBa

CSS 3.0 has a great new features called RGBa.

You can now make a transparent background, transparent text, or just about anything else transparent with RGBa.

.myClass {
background-color:rgba(255,255,255,0.5)
}

The above tag will color your area with a white background that is 50% transparent. The only issue with RGBa at this time is that IE doesn’t support it. The only CSS 3.0 compliant browsers seem to be Firefox and Safari. However, I have tested this in Opera and it does work.

You can also change the color of text element with:

.myClass {
color:rgba(255,255,255,0.5)
}

The old style of transparency is still supported by all browsers

.transparent_class {
filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
}

The major difference between these two styles is that the new method RGBa will only effect the targeted element. Where as with opacity all subclasses are also affected.

Helpful Articles

Diabetic Renal Diet for CKD Patients Diet

Diabetic Renal Diet Guidelines Made Easy! Being that one of the most common extrarenal diseases affecting the kidney is diabetes mellitus, diabetic renal diet has become a topic of interest nowadays...

The Lemonade Diet

There are many people who have the primary goal of weight loss and they turn to the lemonade diet to lose weight quickly...

How Nutrition Affects Your Dog’s Behavior

A very important aspect in owning and taking care of a pet dog is providing the animal with good nutrition and proper nourishment...

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BlinkList
  • blogmarks
  • email
  • Fark
  • LinkaGoGo
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati
  • Twitter
  • Propeller
  • Yahoo! Buzz

Tags: , , , , , , , , , ,

One Response to “How To, Get great looking Transparencies with RGBa”

  1. [...] RGBa will only effect the targeted ellement. Where as with opacity all subclasses are also affected.See the original article and more great CSS Tutorials at CssHowTo.us Tags: background-color, background-image, css, css-background, RGBa, transparencies, [...]

Leave a Reply