我可以将CSS应用于iframe中的元素吗? [英] Can I apply CSS to the elements within an iframe?

查看:129
本文介绍了我可以将CSS应用于iframe中的元素吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常看到使用包含外部网站的iframe的网站,以及包含用户的JavaScript功能的顶部框架。

用户分析软件,Digg bar等...

e.g. user analytics software, Digg bar, etc...

有关类似的东西的实验提示吗? =)会非常了解

Any tips for experimenting on something similar? =) Would be awesome to know

推荐答案

不,不是从外部 iframe。 < iframe> 是它自己的世界。如果域名等匹配,那么Javascript可以进行通信和进行通信,并且可以(如果想)将CSS注入子帧。

No, not from outside the iframe. An <iframe> is its own world. If the domains etc. match, then Javascript can communicate in and out, and could (if it wanted to) inject CSS into a child frame.

如果< iframe> 包含来自不同域的内容,你几乎不能做任何事情。父页面控制框架的大小以及它是否可见,并且可以通过定位等将其自己的内容放置在框架之上,但是它不能直接影响实际框架内容的呈现方式。

If the <iframe> contains content from a different domain, there's pretty much nothing you can do. The parent page controls the size of the frame and whether it's visible, and can put its own content over the frame by positioning etc, but it can't directly effect the way the actual frame content is rendered.

这篇关于我可以将CSS应用于iframe中的元素吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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