0

I'm wondering if there is any way to remove background color from within Iframe original site.. It is only a white color. Can I use javascript??

Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111

2 Answers2

1

Try this

document.getElementById("YourIframeId").contentWindow.document.body.style.backgroundColor="blue";
K D
  • 5,889
  • 1
  • 23
  • 35
1

if the iframe have the same domain as your page you can achieve this via javascript, with something like this

document.getElementById('IFRAMEID').contentDocument.body.style.background = "transparent";

then you'll need to add the transparency attribute to the iframe

ALLOWTRANSPARENCY="true"
Anas Bouhtouch
  • 555
  • 6
  • 15
  • i't is not my domain, it is a third party webmail server login page.. i't has an ugly white background:) – Marko Ivandić Miki Jun 04 '13 at 07:34
  • unfortunately because of the same-origin restriction you can't edit an iframe with a different domain, take a look here for more info: http://en.wikipedia.org/wiki/Same_origin_policy Try to check if they have any API or params to pass to customize the iframe. – Anas Bouhtouch Jun 04 '13 at 08:49