0

I'm struggling to modify the background-color of an iframe.
This iframe aims to load an external page (external domain).
Indeed, I tested the basic way to apply style="background-color:#fff" upon it, but it isn't applied:

<IFRAME allowtransparency="true" style="background-color: #FFF" src="http://pagetoload.htm" width="250" height="420" scrolling="no" frameborder="1"></IFRAME>

Is there a good way to achieve it?

Mik378
  • 21,881
  • 15
  • 82
  • 180
gamliel
  • 21
  • 5

1 Answers1

0
<script type="text/javascript">
$(document).ready(function(){
    $('iframe').contents().find('body').css('backgroundColor', 'white');
});
</script>

this solution makes use of jquery. Don't forget to add jquery library. You can do it with this.