Marko Ivandić Miki
Marko Ivandić Miki

Reputation: 1

HTML Removing Background from within Iframe

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??

Upvotes: 0

Views: 2501

Answers (2)

Anas Bouhtouch
Anas Bouhtouch

Reputation: 546

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"

Upvotes: 1

K D
K D

Reputation: 5989

Try this

document.getElementById("YourIframeId").contentWindow.document.body.style.backgroundColor="blue";

Upvotes: 1

Related Questions