-1

Is it possible to change the CSS of parent page from iframe when parent page and iframe are from different domains?

  • Welcome to Stack Overflow! Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. – Paulie_D Jun 08 '16 at 11:59

1 Answers1

-2

Also, Firefox , Opera, Chrome and even IE8 have adopted the html5 "postMessage" api see this link, which allows secure, cross-domain data transmission between frames, iframes and popups. It works like an event system. IE8 supports this feature, apparently, which is perhaps a little surprising.

Summary: No, you can't directly access/edit the DOM of a page from another domain. But you can communicate with it, and it can co-operate to make the changes you want.

What you're asking is not possible.

See related questions:

Community
  • 1
  • 1
Himanshu
  • 490
  • 1
  • 8
  • 17
  • *"...seem to be adopting.."*? Don't copy 7 year old statements and make them sound like it's something new – charlietfl Jun 08 '16 at 12:58
  • they have adopted it, thanks @charlietfl for pointing out – Himanshu Jun 08 '16 at 13:05
  • Actually my problem is that, I have two websites. Web 1 and Web 2. Web 1 is rendering Web 2 inside it in iframe. As Web 2 is rendering in Web 1, so i want to hide some controls of Web 1 from Web 2. I don't want to do any change in Web 1. I want to control it from Web 2. When i define Css or write some javascript code in Web 2 to hide controls of Web 1. It does not work. – Sheharyar Hanif Jun 09 '16 at 10:48