I have successfully implemented an SVG gradient using an SVG element and some CSS, see below. I have an .SVG image which is black and white and would like to apply the gradient to the black portions of the SVG image.
HTML
<svg width="100" height="50" version="1.1" xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
rect{fill:url(#MyGradient)}
</style>
<defs>
<linearGradient id="MyGradient">
<stop offset="5%" stop-color="#F60" />
<stop offset="95%" stop-color="#FF6" />
</linearGradient>
</defs>
<rect width="100" height="50"/>
</svg>
CSS
rect {
cursor: pointer;
shape-rendering: crispEdges;
fill: url(#MyGradient);
}
Is there a way to apply this directly to an .svg image that I have downloaded?