繁体   English   中英

在移动应用程序的iframe中固定了底部页脚

[英]Fixed bottom footer inside iframe on mobile app

我需要在iframe中固定底部页脚。 在这里,我正在使用全高宽度iframe。 所以现在我在此文件中有一个iframe.html页面,我在这里使用index.html文件,页脚固定。 它可以在网络和Android浏览器上正常运行,但不能在iOS Safari浏览器上运行。

为此,我使用position: fixed页脚中的position: fixed属性。

iframe.html文件

<iframe src="index.html" id="iframe"></iframe>

iframe.html CSS文件

iframe {
    position:absolute;
    top:0;
    left:0;
    width:100%;
    overflow: hidden;
    -webkit-overflow-scrolling:touch;
}

index.html文件

HTML代码

<script>
    for(var i = 0; i < 100; i++)
        document.write("<div> test :: " , i , "</div>");
</script>

<footer>
    <p>footer</p>
</footer>

CSS代码

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padiing: 0.5em;
}

问题在于position:fixed在移动浏览器中的工作方式与台式机相比有些不同。

我建议您通过以下链接

第五位置值

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM