Avner
Avner

Reputation: 5831

How do I embed a transparent SVG object inside an HTML document?

I'm using an SVG object embedded in HTML using the <object> tag. The SVG gets painted with a white background. How can I get rid of it and make the element transparent so that the HTML background shows through.

There is supposed to be a way to do this in IE with Adobe's SVG viewer using the wmode attribute. How do I do this in WebKit or Mozilla?

Upvotes: 3

Views: 8615

Answers (2)

Erik Dahlstr&#246;m
Erik Dahlstr&#246;m

Reputation: 60966

Only webkit-based browsers fail to use a transparent background for <object> elements that reference svg in my experience. See for example the upper-right corner svg on my experimental site, http://dahlström.net/. Opera and Firefox work just fine without anything special needed, just view source and see.

Upvotes: 4

Skilldrick
Skilldrick

Reputation: 70819

Have a look at A List Apart's article on SVG backgrounds.

Upvotes: 1

Related Questions