除非我在iframe中设置高度,否则宽度不会达到100%

时间:2018-12-05 20:25:25

标签: css wordpress html5 iframe html5-canvas

我正在WordPress网站上使用iframe来显示html5动画,但是除非我设置iframe的高度,否则它会减小宽度。

有人可以帮我解决这个问题吗?我尝试了多种方法来修复它,但是没有滚动显示出来,所以我可以获得100%的宽度,只是减小了宽度。

https://tempart.posabilities.co.uk/our-story/

我认为我的动画代码存在冲突:

<div id="animation_container" style="background-color:rgba(255, 255, 255, 1.00); width:960px; height:1615px">
    <canvas id="canvas" width="960" height="1615" style="position: absolute; display: none; background-color:rgba(255, 255, 255, 1.00);"></canvas>
    <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:960px; height:1615px; position: absolute; left: 0px; top: 0px; display: none;">
    </div>
</div>
<div id='_preload_div_' style='position:absolute; top:0; display: inline-block;  width: 960px; text-align: center;'>    <span style='display: inline-block; height: 100%; vertical-align: middle;'></span>  <img src=images/_preloader.gif style='vertical-align: middle; max-height: 100%'/></div>

我还试图使动画在滚动时进行,但是完全迷失了!

1 个答案:

答案 0 :(得分:0)

这是你的;

    #artkiframeHolder {
    height: 1000px;
    width: 100%;
    position: relative;
    overflow: scroll;
}

像这样

#artkiframeHolder {
    height: 1000px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

Fixed