How to override css class set in iframe? [duplicate]

我与影子孤独终老i 提交于 2019-12-25 20:58:26

问题


I have third party iframe widget component on my page. This is all I have as an HTML string in the body of my page. This iframe brings some custom button with style set by that widget.jsp. Chrome inspector doesn't show anything else except <iframe> component. But FireFox shows that button inside <iframe> with style class ".button"

<iframe src='https://www.xxxxxxxx.com/aaa/bbb/widget.jsp?par1='TEST%20BUTTON'></iframe>

So how do I override that .button style class?


回答1:


Browser security does not allow to manipulate third party iframe content via JavaScript. Adding a CSS from outside is also not possible.

The only way to change the style would be from within widget.jsp. Maybe whoever provides you that can also provide a URL parameter, which would allow you to change its appearance.



来源:https://stackoverflow.com/questions/39859634/how-to-override-css-class-set-in-iframe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!