How use an SVG image as a background?

Viewed 11634

I must be doing something wrong. The image was exported from illustrator as an SVG and (I'm not sure whether this is relevant or not) it does have some pixel data in it. Here's my JSFiddle example.

Note that going directly to the image, it shows up just fine: http://ykcreations.com/tv.svg


Edit: This does not work in Chrome or Safari but DOES in Firefox. Webkit issue?

4 Answers

I had a simmilar problem with rendering svg as background image in Chrome, but everything was fine in Firefox. I found out that there was a syntax error inside my svg files exported from Adobe:

wrong xlink attribute:

xlink:href="data:img/png;base64

correct xlink attribute:

xlink:href="data:image/png;base64

Article bellow:

Link to article from css-trick that helped me

Related