Article ID: 937266 - Last Review: October 31, 2007 - Revision: 1.1 A relative URL is not related to an IFrame when you dynamically create a style element that uses a relative URL for an external .css file in an HTML document
SYMPTOMSIn an HTML document, you dynamically create a style element. The style element uses a relative URL for an external cascading style sheet (.css) file. If the HTML document that contains the style element is embedded in an inline frame (IFrame), the relative URL is not related to the IFrame as expected. The URL is incorrectly related to the parent frame. For example, you create an HTML document that is named Parent.html in a folder. This folder also contains a folder that is named Inner. The Inner folder contains an HTML document that is named Child.html and a GIF image that is named Test.gif. You embed the Child.html file into an IFrame in the Parent.html file. In the Child.html file, you dynamically create a style element to reference the URL of the Test.gif file. However, you cannot use "./Test.gif" to reference the URL of the Test.gif file. You must use "../Inner/Test.gif" to reference the URL of the Test.gif file. Note If you hardcode the URL in the HTML document and do not use a .css file, this problem does not occur. WORKAROUNDTo work around this problem, use one of the following methods:
MORE INFORMATION
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
937265
(http://support.microsoft.com/kb/937265/
)
The URL of an ActiveX control is not related to the IFrame when you use the CODEBASE attribute to set the URL of an ActiveX control in an HTML document
| Other Resources Other Support Sites
CommunityArticle Translations |






















Back to the top