Solved

css in iframe

Posted on 2011-02-16
3
416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

691 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