+2  A: 

I can't immediately solve the issue you're experiencing, but I can offer an alternative text-fading solution, if that's of any use?

.text-to-fade {color: rgba(255,255,255,0.0) /* red: 255, green: 255, blue: 255, alpha: 0 */
               }

the value of 0.0 at the end is the alpha value, and can range from 0 to 1, with 0 being opaque and 1 being transparent. rgba has problems on browsers other than Firefox insofar as I've experimented.

perhaps

.text-to-fade {opacity: 0.5; /* for most browsers */
               filter: alpha(opacity=50); /* for IE */
               }
David Thomas
Thank you, I didn't know about that CSS. However, if I understand correctly, this could only create a text-fading-out effect if I would apply it repeated times with different alpha-values to the bottom 3/4/5/? rows of text?What I'm trying to solve is to fade out the text without having to code some logic that counts rows -- because the number of rows could be "anything" due to dynamic content.
Emore
Wouldn't the same problem occur if you use a .png floated over those rows? I'd love to amend my answer and offer a JS/jQuery solution (which would be necessary to amend the CSS values). I'll try and see if I can find a better solution more in keeping with your request.
David Thomas
I would be very happy with any suggestion! However I'm not too familiar with JS/jQuery. But that's no reason not to learn :)
Emore
Yeah, me neither...I keep trying, it keeps hurting my brain for some reason... =)
David Thomas
I just saw your other comment. You can view the site in action at http://eferm.com, where the PNG is in usage. If you find something, let me know! I'll keep trying myself too.
Emore
+2  A: 

The reason it appears to be a different color is because it's transparent, not because the colors are actually different. To demonstrate this, open an image editor that supports layers. Create a white bottom layer and a black top layer. Set the opacity of the black layer to 50% and merge the layers down. Use a color picker to check the color. It's going to be #808080, not black.

The reason it's not fading is because that color is additive. Say your text is #808080 too: in places where there's text, you have #808080 overlaying #808080--and that ends up being something like #424242 rather than canceling out as you want. There's really not a great way to do what you're trying to do inside a web browser in only one step.

One thing to do would be to make the text invisible (visibility: hidden;) with javascript. Another option would be to use relative or absolute positioning and set up the z-indices so things look something like this:

  • 3: TRANSPARENT-GREY
  • 2: button/any other objects
  • 1: OPAQUE-GREY
  • 0: text

That will block out the text and leave anything else partially visible.

Sam DeFabbia-Kane
Ah... I somehow understand. Thank you for the description! However, it seems like I'm left to implement code that senses what row certain words in a paragraph end up in... But that's a different problem.
Emore