Ok, is this possible.
I have a background image. On top of that, I have a transparent grey box for content. I\'d like to have title at the top in text, that is bas
One way is to use -webkit-background-clip: text;
: demo here (webkit only obviously).
Using position, we can sync both backgrounds:
#container, #container h1 {
background: url(bg.png)
}
#container {
position: relative;
}
#container #gray {
background: rgba(0,0,0,.8);
padding-top: 8em;
}
#container h1 {
font-size: 8em;
padding-top: /* padding + border of div */;
position: absolute;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
}
Or you could use the same approach and apply a svg mask, that will work in all modern browsers.