Michael Bell
Michael Bell

Reputation: 184

Transparent HTML

What I would like to do is create a 'div' element in an html document, and using CSS or Javascript/JQuery, change the background transparency so that it looks something like Simple Calendar Widget or Glass Widgets from Android. Does anyone know a way to do this? I have tried the css Opacity function, but it messes with all the text, and if I make a second 'div' and set the transparency of that, I need to manually resize it, which I would prefer not to do.

I apologize if there is a simple way to do this, and I have wasted everyone's time, but I am really stuck on this.

Upvotes: 1

Views: 144

Answers (1)

Adrift
Adrift

Reputation: 59799

You should use the alpha value in rgba(0,0,0,0.5) if you don't want the opacity to affect the descendant text-nodes ..

http://www.w3.org/TR/css3-color/#rgba-color

The only downside is no support below IE 9 (http://caniuse.com/css3-colors)

Upvotes: 1

Related Questions