In Firefox only, if I try to give a svg path a pattern reference like:
path {
fill: url(#ref);
}
in an external style sheet, it renders invisible. If I do it inline, or in a tag on the page, it works.
Here is my fiddle, and here is my code dump because SO won't let me post just the fiddle.
http://jsfiddle.net/v5VDp/1/
<pattern id="texture_base" x="0" y="0" patternUnits="userSpaceOnUse" height="122" width="213">
<image x="0" y="0" width="213" height="122" xlink:href=""/>
</pattern>
<pattern id="texture1" x="0" y="0" patternUnits="userSpaceOnUse" height="122" width="213">
<rect fill='url(#color1)' stroke="none" x="0" y="0" width="213" height="122"/>
<rect fill='url(#texture_base)' x="0" y="0" width="213" height="122"/ />
</pattern>
</defs>
</svg>
.slice:nth-child(6n + 2) path {
fill: url(#texture1);
}
https://dl.dropbox.com/s/wkzaoiwnw6ghsmd/simple_svg_test.css
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…