Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is possible to do this with SVG, though you don't need to do masking, you can just specify the image as a pattern:</p> <pre><code>&lt;defs&gt; &lt;pattern id="img1" patternUnits="userSpaceOnUse" width="600" height="450"&gt; &lt;image xlink:href="daisy-grass-repeating-background.jpg" x="0" y="0" width="600" height="450" /&gt;&lt;!-- Image from http://silviahartmann.com/background-tile/6-grass-meadow-tile.php--&gt; &lt;/pattern&gt; &lt;/defs&gt; </code></pre> <p>Then reference that as the <a href="http://www.w3.org/TR/SVG/pservers.html#Patterns" rel="nofollow noreferrer">fill</a> in your text:</p> <pre><code>&lt;text fill="url(#img1)"&gt; </code></pre> <p>I've done <a href="http://www.boogdesign.com/examples/svg/pattern-fill.svg" rel="nofollow noreferrer">an example</a>, the most painful part was figuring out what <code>patternUnits</code> and <code>patternContentUnits</code> actually did, <a href="https://developer.mozilla.org/en/SVG/Tutorial/Fill_Stroke_and_Gradients#Patterns" rel="nofollow noreferrer">this MDC article was helpful</a>.</p> <p>The text is selectable in Opera and Chrome (and, I presume, Safari) ̶b̶u̶t̶ ̶n̶o̶t̶ ̶F̶i̶r̶e̶f̶o̶x̶ ̶b̶e̶c̶a̶u̶s̶e̶ ̶o̶f̶ ̶a̶ ̶<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=292498" rel="nofollow noreferrer">l̶o̶n̶g̶ ̶s̶t̶a̶n̶d̶i̶n̶g̶ ̶b̶u̶g̶</a> (bug now fixed, expect it to work in Firefox 24 or so). SVG doesn't work in IE (until 9 comes out, anyway) so either don't bother with it or see if you can get VML to do similar things. If you're going to try and build a JavaScript utility to do this a good starting point might be figuring our how to make the above work in <a href="http://raphaeljs.com/" rel="nofollow noreferrer">Raphaël</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload