如何更改iframe内容跨域的样式? [英] How to change style of iframe content cross-domain?

查看:1306
本文介绍了如何更改iframe内容跨域的样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使背景颜色为黑色,文字颜色为白色,内容为iframe中的内容,默认为普通白色背景和黑色文本。
iframe src属性指向不能访问的不同域,或者不能在该域中放置任何文件或样式表。因此,考虑到这些条件,是否可以只在iframe内容中进行这些样式更改,如果是,那么如何?

I want to make background color black and text color white for the content inside iframe from its default of normal white background and black text. The iframe src attribute points to different domain to which I have no access or cannot place any file or stylesheets in that domain. So given these conditions is it possible to make just these style changes in the iframe content and if so then how?

推荐答案

可能性是通过您的代理加载iframe内容并修改HTML内容。您无法通过JavaScript从其他网域访问iframe。

The only possibility would be to load the iframe content through a proxy of yours and modify the HTML content. You can not access iframes from another domain via JavaScript.

这篇关于如何更改iframe内容跨域的样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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