Solved

css in iframe

Posted on 2011-02-16
3
412 Views
Last Modified: 2012-05-11
it appears the page inside an iframe does not respond to css included in the parent page. is that correct?

I used javascript to add in a <link> tag with css. I can see the <link> tag using firebug, but the css file does not even load.

does any one understand why?
0
Comment
Question by:bhomass
  • 2
3 Comments
 
LVL 8

Assisted Solution

by:imantas
imantas earned 125 total points
Comment Utility
That is correct. The page in the iframe is almost completely seperated from the parent. Assume it is a new window opened but embed into the other. You have to load your css inside the iframe.
0
 

Author Comment

by:bhomass
Comment Utility
I wonder if any one has experience with this.

I think the reason I am not able to dynamically insert css is because the iframe is in editor mode.
0
 
LVL 8

Accepted Solution

by:
imantas earned 125 total points
Comment Utility
If you're trying to add CSS to an iframe from the javascript code in the parent frame, then it won't work. It's like a controling one tab from another in your browser. For security reasons this is impossible, and thank god it's made that way.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now