Search code examples
csshtmlmasking

Divs with transparent text in CSS?


I’ve been asked to create a CSS (non-HTML5) based site that has a filled div with a cutout that shows an image underneath it.

Text Cutout Example

There are additional overlays and other images which makes using static images a pain. Plus, I suspect that I am going to need to be able to scale the background as the browser window changes size.

I realize that I can create an image of the GROW text and simply place it on top of the background image, but I would rather see if this effect can be accomplished “for real.”

This needs to work in IE8, 9, and FF 4. I can fallback to another effect for older browsers.

Any suggestions?


Solution

  • I ended up using two images without any holes or transparency. It's a hack but works in all browsers.