views:

36

answers:

2

Take a look at this screenshot from Firefox:

alt text

The two left and right arrows are translucent text, at 20% and 80% opacity. The text has a text-shadow style applied. The images behind them also have varying opacities applied.

Other browsers are working fine - even IE6, in its own pathetic minimal way - but Firefox is drawing a strange black box behind the text. It's not filling the full text area, just the clip of the actual characters.

I know firefox is capable of doing transparency, so any idea what's triggering this strange behaviour?


Update: here's a simple JSFiddle showing the effect. Remove the opacity rule and the problem goes away.

I'm using Firefox 3.6.9 on Linux. The page uses jQuery and jQuery Tools for various opacity fading things, but as the fiddle above shows that isn't causing the issue.

A: 

For opacity issues:

http://davidwalsh.name/css-opacity

.show-50 { -moz-opacity:.50; filter:alpha(opacity=50); opacity:.50; }

Or perhaps better:

.show-50 {
-moz-opacity: 0.5 !important; 
-webkit-opacity: 0.5!important; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)" !important; 
filter: alpha(opacity=50) !important;
opacity: 0.5 !important;}

Read more: http://www.robarspages.ca/web-development/css-opacity-for-all-browsers-cross-browser-compatible/#ixzz13MngpmvC

netadictos
The problem isn't that the opacity isn't having an effect: as you can see in the picture, they really are faded out. The problem is that it injects a background inside the transparent element.
Marcus Downing
A: 

Instead of opacity have you tried background-color:rgba() ? You can control the opacity of the background color alone. You will still need to use opacity for IE

FutureKode
Just tried this, and rgba backgrounds seem to be ignored entirely?
Marcus Downing
are you sure you are using it correctly? background-color:rgba(0,0,0,0.75) == black background color at .75 opacity
FutureKode