banner



How To Change Iframe Background Color In Wordpress

6 Answers 6

An <iframe> background tin can be inverse similar this:

                <iframe allowtransparency="true" style="background: #FFFFFF;"      src="http://zingaya.com/widget/9d043c064dc241068881f045f9d8c151"      frameborder="0" height="184" width="100%"> </iframe>                              

I don't recall it'south possible to change the background of the folio that you lot take loaded in the iframe.

user avatar

ashleedawg

18.4k 7 gold badges 65 argent badges 93 statuary badges

answered February 12, 2013 at ten:59

user avatar

1

  • I desire to modify the background of loaded page

    February 12, 2013 at 11:01

JavaScript is what y'all demand. If you are loading iframe when loading the page, insert the test for iframe using the onload consequence. If iframe is inserted in realtime, then create a callback function on insertion and claw in whatever activeness y'all demand to have :)

answered Feb 12, 2013 at fourteen:07

user avatar

1

  • information technology would be dainty, if could provide the code (I'm not proficient in Java Script)

    Feb thirteen, 2013 at 4:23

You can do it using javascript

  • Change iframe background color
  • Change background color of the loaded folio (same domain)

Plain javascript

                var iframe = certificate.getElementsByTagName('iframe')[0]; iframe.style.groundwork = 'white'; iframe.contentWindow.document.body.style.backgroundColor = 'white';                              

jQuery

                $('iframe').css('groundwork', 'white'); $('iframe').contents().discover('body').css('backgroundColor', 'white');                              

answered May 27, 2018 at 5:09

user avatar

0

just building on what Chetabahana wrote, I constitute that adding a short delay to the JS function helped on a site I was working on. It meant that the function kicked in afterwards the iframe loaded. Y'all can play effectually with the delay.

                var delayInMilliseconds = 500; // half a 2nd  setTimeout(function() {      var iframe = document.getElementsByTagName('iframe')[0];    iframe.style.background = 'white';    iframe.contentWindow.certificate.torso.style.backgroundColor = 'white';  }, delayInMilliseconds);                              

I promise this helps!

answered April 24, 2019 at 14:33

user avatar

0

answered Aug xviii, 2020 at 15:43

user avatar

Put the Iframe between aside tags

<aside style="background-color:#FFF"> your IFRAME </aside>

user avatar

Robert

5,221 43 gold badges 62 silverish badges 113 statuary badges

answered February 10, 2016 at nine:41

user avatar

ane

  • Might desire to explain how putting an iframe in an aside will change its background color

    Aug 17, 2018 at 3:14

Not the answer y'all're looking for? Browse other questions tagged html iframe groundwork-color or ask your own question.

Source: https://stackoverflow.com/questions/14830852/change-background-color-of-iframe-issue

Posted by: henrypeargen.blogspot.com

0 Response to "How To Change Iframe Background Color In Wordpress"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel