Currently, you cannot achieve this using only CSS. However, you can do this in webkit-based browsers (Safari, Chrome, etc.) using CSS extensions and emulate via SVG in other modern browsers that support SVG.
Example markup for webkit-based browsers:
<!DOCTYPE html> <html><head> <title>Foo</title> </head><body> <div class="mask"> <h1>Masked Text</h1> </div> </body></html>
and css:
.mask { font-size:90px; font-family:Arial, sans; font-weight:700; background:white url(/image.jpg) repeat; -webkit-text-fill-color: transparent; -webkit-background-clip: text; }
See a working example here: http://jsfiddle.net/Q9JWM/ (works only with Chrome and Safari)
Also experiment SVG emulation to get hidden text effect.
source share