iPad 机身尺寸 CSS 问题
这是我刚刚创建的网站。 http://www.imageworkz.asia/TheHatLab
问题是在 iPad 中查看时。即使在样式表中将正文的宽度和高度设置为 1024 x 768,如果处于横向方向,则右侧会有多余的正文背景(黑色);如果处于横向方向,则右侧和底部也会有多余的正文背景(黑色)。处于纵向方向。
有什么想法吗?
this is a website I just created. http://www.imageworkz.asia/TheHatLab
the problem is that when it is viewed in the iPad. Even if the body's width and height were set to 1024 x 768 in the stylesheet, it has an excess background of the body (the black one) on the right side if it is on landscape orientation and on the right side and bottom side if it is on portrait orientation.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否尝试过阻止页面缩放? http://davidwalsh.name/zoom-mobile-browsers
或者您是否尝试过实现视口 http://www.allenpike .com/2010/choosing-a-viewport-for-ipad-sites/
Have you tried preventing page zoom? http://davidwalsh.name/zoom-mobile-browsers
Or have you tried implementing a viewport http://www.allenpike.com/2010/choosing-a-viewport-for-ipad-sites/
您已将主体尺寸指定为 1024x766。为容器指定尺寸,而不是为主体指定尺寸。这对我有用。可能是由于视图端口大小调整涉及 html &身体元素。
You have given the size 1024x766 to the body. Give size to the container not into body. It worked for me. May be due to view port sizing involves html & body elements.
您可以隐藏地址栏(您可以找到很多这方面的信息)或者您可以将内容的大小减小到剩余空间(或者您可以进行调整以填充可用空间的布局)。
You can hide the address bar (you can find lots of information on this) or you can reduce the size of your content to the space remaining (or you can do a layout that adjusts to fill the available space).
你研究过视口吗?
例如:
Have you investigated viewport?
eg:
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">