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??
Asked
Active
Viewed 2,055 times
0
-
used to this iframe html body{background:#fff;} – Rohit Azad Malik Jun 04 '13 at 06:18
-
Using jQuery or pure javascript solution here: http://stackoverflow.com/questions/10299515/change-body-background-color-in-an-iframe-using-one-css-file – Irvin Dominin Jun 04 '13 at 06:22
2 Answers
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