简体   繁体   English

在移动设备上显示时,元素不会居中,背景也不会固定

[英]The element won't be centered when displaying on mobile device and background won't be fixed

I have just finished my website and I got a problem when I open it on mobile device (I tested with iPad 2). 我刚刚完成我的网站,但是在移动设备上打开它时遇到了问题(我在iPad 2上进行了测试)。 The issue is that the container that contains every element is not aligned on the center of the page, it lies a little bit on the left. 问题是包含每个元素的容器未在页面中心对齐,而是位于左侧一点。 The second issue is that I fixed the background to be non-repeat but it doesn't work on mobile device 第二个问题是我将背景固定为不可重复,但是在移动设备上不起作用

Note that everything is fine on PC. 请注意,在PC上一切正常。 The problems occur only in mobile device. 仅在移动设备中会出现问题。

I don't know how to post all the code here so I give you this URL which gets you through my website 我不知道如何在此处发布所有代码,因此我给您提供此URL,使您可以访问我的网站

http://flourishtech.freevar.com/ http://flourishtech.freevar.com/

Please open it in mobile device to see the issues. 请在移动设备中打开它以查看问题。

The background issue: Your website although works on mobile is not responsive, so safari shows the entire website on the window. 背景问题:您的网站虽然可以在移动设备上使用,但无法响应,所以Safari会在窗口上显示整个网站。 This creates your issue because the background is too small and it doesn't fit the entire page. 这会造成您的问题,因为背景太小并且无法容纳整个页面。 The quick solution is to get a background that fir the full height or make the website responsive. 快速的解决方案是获取一个可以激发整个高度的背景或使网站具有响应能力。

For centering the website on ios, check this post. 要使网站以ios为中心,请查看此信息。

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

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