Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Created May 4, 2012 12:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save LeaVerou/2594420 to your computer and use it in GitHub Desktop.
Save LeaVerou/2594420 to your computer and use it in GitHub Desktop.
Text masking — The SVG way
/**
* Text masking — The SVG way
*/
svg {
width: 6em; height: 1.5em;
font: 900 500%/1.2 'Arial Black', sans-serif;
}
text { fill: url(#wood); }
<svg>
<defs>
<pattern id="wood" patternUnits="userSpaceOnUse" width="400" height="400" >
<image xlink:href="http://subtlepatterns.com/patterns/purty_wood.png" width="400" height="400" />
</pattern>
</defs>
<text y="1.2em">SVG rocks!</text>
</svg>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment