I was wondering if it’s possible to achieve transparent text inside a container with a solid background color. The transparent text allows you to see the image behind the container.
Something like this
Found this with a google search. The image was created in photoshop. Can this effect be achieved with CSS? If so, how?
Just curious.
2
Answers
I hope this will be what you are looking for
All you just want to do is setting
-webkit-text-fill-color
orcolor
totransparent
and-webkit-background-clip
totext
. Simple 🙂Another approach is by using
clip-path
and by using an SVG image as the mask – the SVG image itself can contain text. This has support in WebKit and Gecko but not IE ( http://caniuse.com/#feat=css-masks )https://css-tricks.com/clipping-masking-css/