0

I have it in my mind to create:

  1. A patterned fixed background
  2. A white background layer overtop of the patterned background
  3. "transparent" text that is also transparent through the white background so the patterned background as the text.

For those wiser than me out there... is this even possible? If so how?

The text transparency is easy enough rgba(0,0,0,0.1) but I can't get it beyond the white layer to the pattern.

The code so far:

#inner-header {
background: url('../images/white.png'), url('../images/angusplaid.png');
position: fixed;
z-index: 1;
}

#logo a {
color: rgba(0,0,0,0.1)
}

Is there a way to make the white background transparent only where the text is? I have my doubts but would love to have it solved either way.

Cheers.

  • 3
    Welcome to SO, please provide the code you have tried and even better, put it in a fiddle or other so we can play with it and find a solution for you. – web-tiki May 26 '14 at 20:46
  • maybe same as text? `background: rgba(255,255,255, 0.9);` – gomflo May 26 '14 at 20:47
  • Thanks for the quick responses. I'll get the code up in a jiffy – user3677609 May 26 '14 at 21:08
  • See http://stackoverflow.com/questions/22314322/cutting-a-triangle-out-of-div-but-have-it-horizontally-centered/22314879#22314879 for something to get you started. – Etheryte May 26 '14 at 21:55
  • thanks @Nit. That's exactly what I was looking for, albeit not in svg. – user3677609 May 26 '14 at 22:59
  • See [http://css-tricks.com/image-under-text/](http://css-tricks.com/image-under-text/), as there's currently no cross-browser solution for this other than SVG. – Etheryte May 26 '14 at 23:22

1 Answers1

0

You have various options:

The first is with CSS background-clip.

The second is with SVG (SVG.js)

I'm sure some text to bitmap options must exist too.

wout
  • 2,477
  • 2
  • 21
  • 32
webketje
  • 10,376
  • 3
  • 25
  • 54