gpt4 book ai didi

HTML div 未覆盖 iPhone 中的完整 100% 宽度

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:29:49 24 4
gpt4 key购买 nike

我已将网站上传到我的服务器以在 iphone 上进行测试。然而,页脚在 iPhone 上并没有覆盖整个宽度,尤其是在 Safari 网络浏览器上。我相信这与我在 #header 中的绝对定位 DIV #leaf-print 有关。

我在 Stackoverflow 上看了几十篇文章,但仍然找不到解决方案。该站点位于:www.azumis.com/clients/onaturals .理想情况下,我需要某种 CSS 代码来强制 iPhone 屏幕上视口(viewport)的宽度为 952px。任何帮助将不胜感激。谢谢

enter image description here

最佳答案

你正在使用

html,body{
width:952 px;
}

将其更改为

html,body{
width:100%;
margin:0;
padding:0;
}

SCREENSHOT AFTER THAT CHANGE

问题仍然存在,因为::

虽然你已经做了改变 html,body{width:100%;} 但你再次覆盖它

body{
width:952px; /*..why????..as you have done it after html,body{width:100%;} its overriding the width:100% to width:952px;
}

改成

 body{
width:100%;
margin:0;
padding:0;
overflow-x:hidden;
}

也制作

 #footer{
width:100%; /*...instead of 1024px;...*/
}

如果仍然无法正常工作,以下代码可能对您有所帮助

 #footer{
width:100%; /*...instead of 1024px;...*/
position: absolute;
right: 0;
left: 0;
}

关于HTML div 未覆盖 iPhone 中的完整 100% 宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18673788/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com