homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

iframe external css files

5+ Year Member

Msg#: 4188559 posted 10:00 am on Aug 18, 2010 (gmt 0)

I have a website that has an iframe called on the page that is filled with another website that calls a only-when-viewed-in-an-iframe stylesheet. Would a css file from the main site overwrite styles of the iframe stylesheet for elements in the iframe?

<html><body><head><link rel="stylesheet" src="style.css" /></head><iframe src="mysite.com"></iframe></body></html>

So would the styles in style.css overwrite the styles set in the stylesheet that is called with mysite.com from the iframe?



Msg#: 4188559 posted 4:02 am on Aug 20, 2010 (gmt 0)

If I understand your description correctly. Nope.

The contents of the <iframe> are like a whole separate browser window. In fact, unless the parent and the <iframe> source come from the exact same domain name, I don't think they can have any interaction at all, as a security precaution.

BTW, I notice your code above has a bug in it. <head> should close before <body> opens. I hope you've got it that way on the live page.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved