title: Is it good to edit the css dynamically with javascript injecting css code in the head?
body: <p>Is it "legal" and working cross browser the injection of CSS code in the head in order to set/change permanently the properties of something?</p>
  
  <p>For example (using jQuery):</p>
  
  <pre><code>$('head').append('&lt;style&gt;.myclass { background: #f00;}&lt;/style&gt;');
  </code></pre>
  
  <p>I've tried it in Safari 7 and works.</p>
  
  <p>Is it ok and cross browser or is a hack to avoid?</p>
  
  <p>Are there any drawbacks?</p>