I add iframe from external site to mine like this:
<iframe src="http://site.com/page/"></iframe>
It has some own css and javascript files.
How can I add my own css styles to this iframe?
asked Oct 31, 2010 at 18:50
James
43.9k54 gold badges138 silver badges163 bronze badges
2 Answers 2
If the iframe source is not the same domain as your site, you can't add your own CSS to it due to same origin policy.
answered Oct 31, 2010 at 18:55
BGerrissen
21.7k4 gold badges41 silver badges40 bronze badges
Sign up to request clarification or add additional context in comments.
2 Comments
Chuck
@Happy: SOP applies to Javascript as well.
BGerrissen
Only trick I can think of is to use a serverside proxy, but thats a can of headaches.
Are you trying to format the iframe border or its content? The latter isn't allowed for security reasons, the former can be archieved with a simple stylesheet (selector "iframe").
answered Oct 31, 2010 at 18:58
thejh
45.7k18 gold badges100 silver badges109 bronze badges
default