iframe中的样式内容 [英] style content within an iframe

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

问题描述

我必须在iframe中设定样式。

 < html& 
< head>
< link href =url / to / my / custom.css>< / link>
< / head>
< body>
......
< iframe class =webform-frame> ...< / iframe>
< / body>
< / html>



在我的custom.css中我已经尝试使用 .webform-frame h5 {color:#f00; } ,但它不工作。



iframe是由一些JavaScript生成的(我没有访问它)。


解决方案

任何想法如何在那个iframe中创建样式?想要定位 iframe ,即边框,边框颜色,填充或边距,然后使用此将定位您的 iframe

  iframe.webform-frame {
/ *样式* /
}

如果您尝试定位加载到 iframe 注意:你可以控制一些东西,例如使框架背景透明等。








编辑:想要添加 属性解释在这里,如Sebastian所说,但
支持是穷人,你应该也许忽略这样做..也不要编辑
任何iframed页面未经预先许可页面所有者



I have to style something within an iframe.

<html>
 <head>
   <link href="url/to/my/custom.css"></link>
 </head>
 <body>
    ......
    <iframe class="webform-frame">...</iframe>
 </body>
</html>

In my custom.css I already tried to use .webform-frame h5 { color: #f00; } but it doesn't work.

The iframe is generated by some JavaScript (I have no access to it).

Any idea how I could style that stuff within that iframe?

解决方案

If you want to target the iframe i.e the border, border color, padding, or margin, then using this will target your iframe:

iframe.webform-frame {
   /* Styles */
}

If you are trying to target the markup which is loaded inside the iframe than that's not possible.

Note: You can control a few things like making the frame background transparent etc...


Edit: Would like to add seamless attribute explanation here, as Sebastian told, but the support is poor, you should perhaps ignore doing so.. Also do not edit any iframed pages without prior permission of the page owner

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

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