title: Injecting CSS String as New Document Stylesheet
body: <p>I am dynamically creating a large stylesheet as a string and desiring to injecting it into an iframe. Initially I approached it like this:</p>
  
  <pre><code>var css = '.newstyle { margin: 20px; } .newstyle2 { margin: 20px; }';
  $('iframe').contents().find('head').append('&lt;style type="text/css"&gt;'+css+'&lt;/style&gt;');
  </code></pre>
  
  <p>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 enable me to inject a mass of CSS from a string?</p>