css from iframe to parent page

css from iframe to parent page

I would like to add css from iframe...

i have a file e.g. test.com/test.html and only filled with:

  1. <style type="text/css">
  2. .nanana01 {background:#000 !important}
  3. </style>

then i want the page which has my iframe css change the background e.g. otherpage.com.

  1. <html><body>
  2. <div class="nanana01">
  3. text 1
  4. text 2
  5. </div>
  6. <div class="mypost">
  7. <iframe src="test.com/test.html"></iframe>
  8. </div>
  9. </body></html>

i wonder is there any javascript that apply my css into the parrent page?

what should i put in test.com/test.html?