Click to See Complete Forum and Search --> : How to use Parent page css file in iframe page


GurusGuru
09-02-2005, 06:12 AM
How to use the same .css file of the parent page in the html page called through IFRAME. I am using style switcher to change the .CSS files. While changing the style sheet, it does so in the parent page but not in the iframe page.

Kravvitz
09-02-2005, 06:46 AM
Sounds like you need a customized stylesheet switcher.

Why Frames Are Bad (http://karlcore.com/articles/article.php?id=2)
http://apptools.com/rants/framesevil.php
http://www.456bereastreet.com/archive/200411/who_framed_the_web_frames_and_usability/
Why Frames Suck (Most of the Time)(1996) (http://www.useit.com/alertbox/9612.html)
What's wrong with frames? (http://www.htmlhelp.com/design/frames/whatswrong.html)

ray326
09-02-2005, 01:57 PM
Have you tried removing any external sheet references from the included pages? My experience has been that the iframe doc will be styled by the container's styles if it doesn't declare styles of its own.

GurusGuru
09-03-2005, 12:58 AM
Got It. Using the following code to get the css file. Working fine so far.

<script language="JavaScript" TYPE="text/javascript" src="styleswitcher.js"></script>
<script language="JavaScript">
<!--
document.write("<LINK REL=STYLESHEET HREF=\"" + selectedCSS + "\" TYPE=\"text/css\">");
//-->
</script>
<noscript><link rel="stylesheet" type="text/css" href="xyz.css"></noscript>