Timeline for How to apply a style to an embedded SVG?
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 10, 2023 at 0:44 | comment | added | Sam Sabin | Also what do you mean by the fact that the code assumes the object has already been loaded? Does that mean you couldn't change the SVG on page load, only afterwards using a button or something like that? | |
Feb 9, 2023 at 23:26 | comment | added | Sam Sabin | What do you mean by "yourObjectElement". I'm a little confused what should be replaced there. Would that also be a "getElementByID"? | |
Jun 6, 2021 at 11:00 | comment | added | Ahmed Shehab | Thanks for the answer, it was enlightening :) | |
S Mar 18, 2016 at 21:01 | history | edited | Toby Allen | CC BY-SA 3.0 |
Update 2015 and updated txt speak.
|
S Mar 18, 2016 at 21:01 | history | suggested | mohammadreza berneti | CC BY-SA 3.0 |
Update 2015
|
Mar 18, 2016 at 20:54 | review | Suggested edits | |||
S Mar 18, 2016 at 21:01 | |||||
Apr 16, 2015 at 7:47 | history | edited | Erik Dahlström | CC BY-SA 3.0 |
clarify that the code assumes that the frame has finished loading
|
Oct 14, 2014 at 21:59 | vote | accept | Joshua Sortino | ||
May 16, 2014 at 14:36 | comment | added | guibar |
The line var svgDoc = yourObjectElement.contentDocument; returns null. The only way I managed to get this working was with a load listener on the Element and inside it get the contentDocument as illustrated here: stackoverflow.com/questions/2753732/…
|
|
Nov 6, 2013 at 3:26 | comment | added | Dave | Thank You Erik, was really struggling trying to get font-face to work in svg through css, linking the css into the svg worked first try and miraculously cross browser! | |
Jul 15, 2012 at 18:41 | comment | added | Erik Dahlström | @MattW-D: you should probably just open a new question for that. Svgweb is not needed in chrome. | |
Jul 14, 2012 at 23:48 | comment | added | Matt W-D | This is pretty awesome Erik! However, I couldn't manage to get this trick to work in Chrome without including svgweb: code.google.com/p/svgweb ...Any idea's what I'm doing wrong? | |
Feb 7, 2011 at 12:37 | history | edited | Erik Dahlström | CC BY-SA 2.5 |
added non-scripted versions; deleted 16 characters in body
|
Feb 6, 2011 at 11:40 | history | edited | Erik Dahlström | CC BY-SA 2.5 |
answered followup question with more detail
|
Feb 6, 2011 at 11:32 | comment | added | Erik Dahlström | The above inserts a style element into the svg. Yes it's possible to insert an xhtml link element too for linking to an external stylesheet, or possibly an xml-stylesheet processing instruction (see w3.org/Style/styling-XML.html). | |
Feb 6, 2011 at 0:33 | comment | added | Joshua Sortino | Is this a method to link an external stylesheet? If not, is that possible? | |
Feb 5, 2011 at 11:30 | history | answered | Erik Dahlström | CC BY-SA 2.5 |