Solved

css in iframe

Posted on 2011-02-16
3
414 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
ID: 34912686
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
ID: 34913463
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
ID: 34915485
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

830 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