Masking text for transparency in CSS (cross-browser, not IE-6 or lower)

I need a black box filled with transparent text above the background image.

See this example: Example

Is it possible? If so, how can I do this?

+4
source share
2 answers

While there is no cross-browser solution, only webkit seems to support masks.

-webkit-mask-image: url(/path/to/mask.png); 

http://trentwalton.com/2011/05/19/mask-image-text/

+3
source

Here is a great reference showing what you just want what you need.

http://www.silenceit.ca/2011/03/11/css-gradients-and-webkit-image-masks-on-text/

However, the solution, as with all alpha masks, is not fully compatible with the browser. I'm afraid!

+1
source

All Articles