Forum Moderators: open

Message Too Old, No Replies

Using Javascript to apply CSS styles to IFrame external page

Is this possible?

         

jelewis8

2:58 am on Aug 3, 2007 (gmt 0)

10+ Year Member



Here's what I have: an external page (not controllable by me) loading in an iframe element, which then displays on a page I am hosting.

I would like to apply a css style to the contents of the iframe--not the iframe element itself!--but what's inside. I know that CSS only applies to the page it's referenced in, so doing this by normal means isn't possible.

However, I thought Javascript might have a solution. However, I am not very experienced with it, and don't have much insight into where to start, much less complete such a mysterious undertaking.

Any ideas? Has anyone ever tried to do this?

daveVk

5:10 am on Aug 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I assume the IFrame and main page are from different domains, in this case cross domain security will pervent you seeing the iframe content or changing it. A way around it is to has your server relay the iframe content.