title: changing style of loaded iframe
body: <p>I am using an iframe as a kind of lightbox container and I need to change the style of the contents of the iframe after it is loaded with a url, however I seem unable to be able to do this either with css or with jquery.</p>
  
  <p>I have tried:</p>
  
  <pre><code>iframe html body {text-align:center}
  $('iframe html body').css('text-align','center');
  </code></pre>
  
  <p>And neither appears to have any effect, I have also tried setting other attributes, but it has no effect on the contents at all.</p>
  
  <p>Can this be done ??</p>
  
  <h1>EDIT</h1>
  
  <p>OK, this appears to be a browser-related issue, I am actually trying to dynamically set the width and height of the iframe according to the contents loaded:</p>
  
  <pre><code>$('iframe').load(function () {
     $(this).height($(this).contents().height());
     $(this).width($(this).contents().width());
  });
  </code></pre>
  
  <p>This works in safari and chrome, but has no effect at all in Firefox !</p>