【问题标题】:Iframe Not Respecting Height Attributeiframe 不尊重高度属性
【发布时间】:2016-09-23 10:07:43
【问题描述】:

我一直在尝试向我的 wordpress 网站添加一个 javascript 地图,但由于某种原因 iframe 不尊重我设置的高度属性。

我已经尝试过使用 标记,甚至使用插入式短代码。这两行都可以在这里看到:

<iframe src="https://www.shiftins.com/county/index.html" width="100%" height="900" scrolling="no"></iframe>

[iframe src="https://www.shiftins.com/county/index.html" width="100%" height="600"]

并且可以在此页面上实时查看:https://www.shiftins.com/test-page-1/

我在我网站的其他部分运行 iframe,它们可以正常工作。我该如何解决这个问题?

顺便说一句,我试过了!重要但仍然没有运气。

【问题讨论】:

    标签: javascript jquery html wordpress iframe


    【解决方案1】:

    在您的实时网站上,iframe 的高度设置为“height:150px”样式:

    如果你从你的 css 中删除它,它会像一个魅力一样工作:

    【讨论】:

    • 绝对是这样。当我“检查元素”并改变高度时,它就像一个魅力;但是,我将代码中的高度设置为 > 150px,并且我的 css 文件中没有默认设置。你知道什么是超高吗?
    猜你喜欢
    • 2012-09-03
    • 1970-01-01
    • 2012-10-14
    • 2011-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-03
    • 2021-11-12
    相关资源
    最近更新 更多