1 Replies - 2131 Views - Last Post: 23 December 2009 - 06:54 AM

#1 SphereCat1   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 29-October 09

Dynamically apply CSS to SVG inside <object>

Posted 30 November 2009 - 06:05 PM

Hi again! I'm wondering how to add CSS styling to and SVG document once it has been embedded into an <object> tag. This is inside of an HTML5 document.
I've tried using inline SVG, which works, but only in Firefox, since the other browsers require it to be XHTML to have inline anything.
I also tried dynamically loading the SVG with AJAX and adding it to an XHTML file embedded in the <object>, but it only worked in Firefox for some reason. The other browsers did display an inline SVG in that file if it was there to start with, however. This seems like the best option, so does anyone know why it didn't work?

Adding the stylesheet directly to the SVG isn't a viable option, because of my workflow. Creating a seperate XHTML document for each SVG would work, but it's not as clean as I would like.

Thanks for any help you can supply! :)
SphereCat1

Is This A Good Question/Topic? 0
  • +

Replies To: Dynamically apply CSS to SVG inside <object>

#2 SphereCat1   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 29-October 09

Re: Dynamically apply CSS to SVG inside <object>

Posted 23 December 2009 - 06:54 AM

No replies, but I found a different way to do it anyway!

SphereCat1
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1