开发者

Apply parent style to page in frame

开发者 https://www.devze.com 2023-02-09 15:02 出处:网络
Is there any way to apply the CSS of a parent page to a page within a frame without adding another http request in the page in the frame? Is this possible or would I have to add the CSS via http reque

Is there any way to apply the CSS of a parent page to a page within a frame without adding another http request in the page in the frame? Is this possible or would I have to add the CSS via http request in every page loaded in the frame? In开发者_JAVA百科 the case that it wouldn't work, would it be more convenient to use style tags or link rel if each page were to have a unique CSS? I ask this because they're pages from my site which are only made to contribute to the parent page which has them in frames. The reason for frames being that there is more going on in other areas of the page and everything acts in unison; it'd be convenient not to reload everything for one section.


Set up your cache control headers right and using a <link> will fetch the CSS from the browser cache and not from the server.


No, you would have to put a link element in the iframe's source, which would

1) trigger a new http request
2) it wouldn't work on cross domain websites, because
    a) XSS (en.wikipedia.org/wiki/Cross-site_scripting)
    b) you would likely not have access to the source to edit it, because it's on a different server.

lists like these are fun. you should try making some of them :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号