I am dynamically creating a large stylesheet as a string and want to enter it in an iframe. I originally approached like this:
var css = '.newstyle { margin: 20px; } .newstyle2 { margin: 20px; }'; $('iframe').contents().find('head').append('<style type="text/css">'+css+'</style>');
Unfortunately, IE7 does not like this method. I'm not sure how else to approach this injection. Is there a cross-browser solution that will allow me to insert a ton of CSS from a string?
source share