【问题标题】:Setting an iframe's inner html5 object width to 100%将 iframe 的内部 html5 对象宽度设置为 100%
【发布时间】:2015-09-02 00:30:31
【问题描述】:

我试图在 iframe 中创建一个 html5 对象,设置为 100% 宽度,但无济于事。目前,内部 html5 对象的宽度溢出 iframe 边界并且不适合,所以我试图限制它。我用过这样的代码:

#quote iframe object {
    width: 100% !important;
}

这似乎不起作用。有什么方法可以轻松定位内部 html5 元素?

谢谢!

【问题讨论】:

  • 很遗憾,您无法定位 iframe 内的元素。

标签: css html object iframe width


【解决方案1】:

您无法在 iframe 中访问。 iframe 就像新的浏览器窗口。您无法从一个窗口访问另一个窗口。

【讨论】:

    【解决方案2】:

    虽然您无法定位 iframe 中的特定项目并调整它们的大小,但您可以将 iframe 整体缩放到适当的大小。如果你的 iframe 的内部对象超出了它的边界,也许这就是你需要的。看看这个问题:How can I scale the content of an iframe?

    【讨论】:

      猜你喜欢
      • 2014-05-26
      • 1970-01-01
      • 2013-05-14
      • 1970-01-01
      • 2016-08-09
      • 1970-01-01
      • 2018-10-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多