views:

58

answers:

2

I add iframe from external site to mine like this:

<iframe src="http://site.com/page/"&gt;&lt;/iframe&gt;

It has some own css and javascript files.

How can I add my own css styles to this iframe?

+5  A: 

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.

BGerrissen
maybe some javascript trick?
Happy
@Happy: SOP applies to Javascript as well.
Chuck
Only trick I can think of is to use a serverside proxy, but thats a can of headaches.
BGerrissen
A: 

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").

thejh
it adds overlay and some text, I want to change the colors and some styles.
Happy
If the overlay is a frame, I think that it's not possible.
thejh