从iframe的调用者页面更改iframe内容css [英] Change iframe content css from the caller page of the iframe

查看:102
本文介绍了从iframe的调用者页面更改iframe内容css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能吗?
我想要一个make自适应布局,但CSS或JS都不能强制iframe内容从调用页面改变。
但iframe页面和调用者使用相同的CSS和JS文件。

Is it possible? I want an make an adaptive layout but neither CSS or JS can force the iframe content to change from the calling page. However the the iframe pages and the caller use the same CSS and JS file.

推荐答案

这是唯一可行的,如果他们来自同一个来源。如果两者都使用相同的CSS或JS文件并不重要。这意味着,两者都使用相同的域名,应用层协议和(在大多数浏览器中)端口号。 (同源政策

This is only possible, if they are from the same origin. It doesn't matter if both use the same CSS or JS file. That means, both are using the same domain name, application layer protocol, and (in most browsers) port number. (Same origin policy)

如果您确定满足上述要求,请检查以下链接:

If you are sure that you fullfil the above mentioned requirements, please check the following links:

  • Adding a stylesheet to an iframe
  • How to apply CSS to iFrame?
  • How to load up CSS files using Javascript?

这篇关于从iframe的调用者页面更改iframe内容css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆