简体   繁体   English

iPhone上奇怪的黑色区域

[英]Strange black area on IPhone

I have a strange problem. 我有一个奇怪的问题。 The website is using a template and on IPhone it is showing a strange black vertical bar on the right side. 该网站正在使用模板,而在iPhone上,它在右侧显示了一个奇怪的黑色竖线。

I installed safari and activated the user agent. 我安装了野生动物园并激活了用户代理。 When I set the agent to the ipad, I am seeing the problem, but client told me its on his IPhone. 当我将代理设置为ipad时,我看到了问题,但客户在他的iPhone上告诉了我。

Strangely when I look with dev tools, it seems to be outside the html. 奇怪的是,当我使用开发工具时,它似乎不在html之外。 What could be causing this? 是什么原因造成的? I have already tried to set html and body to 100% width and overflow-x to hidden, but it did not help. 我已经尝试将html和body设置为100%宽度,将overflow-x设置为隐藏,但这并没有帮助。

I have included a screenshot: 我包括了一个屏幕截图:

在此处输入图片说明

I have never seen anything like this before. 我以前从未见过这样的东西。 What could it be? 会是什么呢? thanks verymuch! 非常感谢!

ADDITION: 加成:

Here a live example: 这是一个实时示例:

example offline, sry 离线示例,很抱歉

Somewhere, at some point, you have an element with some extra padding, border or margin that is blowing things out. 在某个位置的某个地方,您的元素带有一些额外的填充,边框或边距,这使事情变得井喷。 I couldn't track it down, but an easy way to kill it off these days is with this in your style sheet (which is commonly used as part of a standard reset): 我无法对其进行跟踪,但是如今,一种简单的方法可以消除它,即在样式表中使用它(通常用作标准重置的一部分):

*, *:before, *:after {-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}

That seems to fix the issue, although on your next project, I recommend not setting fixed widths, but rather use width: 100% etc, as users on screens narrower than 300px will still have issues. 这似乎可以解决问题,尽管在您的下一个项目中,我建议不要设置固定宽度,而应使用width:100%等,因为屏幕小于300px的用户仍然会遇到问题。

ok, so its a render issue on iphones and window phones. 好的,所以它在iPhone和视窗手机上会出现渲染问题。 I cant replicate the issue on google chrome and samsung galaxy. 我无法在Google Chrome和三星银河上复制该问题。 Due to the below... 由于以下原因...

Put... 放...

            <section id="main-top">
                <div id="bg">

inside the .container . .container You will have to re-assign your background. 您将不得不重新分配背景。 But the problem is with the nav and background and the positioning of these divs. 但是问题在于导航和背景以及这些div的位置。

Your nav is full width but the container isn't, you have the section and div ending within the container but starts outside of it. 您的导航是全角的,但是容器不是,您的section和div在容器内结束但在容器外开始。

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

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