1

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

2 Answers 2

6

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
Sign up to request clarification or add additional context in comments.

2 Comments

@Happy: SOP applies to Javascript as well.
Only trick I can think of is to use a serverside proxy, but thats a can of headaches.
0

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

2 Comments

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.