HTML CSS 布局在 iPad 横向模式下缩小?
我正在为iPad制作一个布局,布局的宽度是950px,当我进入横向模式时,我没有得到任何水平滚动条(实际上我应该有,因为布局的宽度以像素为单位固定,950px而不是786px)全部都是很好,但顶部标题栏的高度正在缩小。
我做错了什么。我希望我的布局在横向模式下不应该缩小。每个元素应该具有与纵向模式相同的高度。
I'm making a layout for iPad and width of layout is 950px and when I go into landscape mode I'm not getting any horizontal scroll bar ( which actually I should have because layout's width is fixed in pixel which 950px not 786px) all is fine but top title bar's height is shrinking.
What I'm doing wrong. I want my layout should not be shrinking in landscape mode. each element should have same height like portrait mode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我怀疑
viewport
元点击可以调整您网站的大小。尝试将初始值固定为 1,最小值固定为最大值。https://developer.apple.com/库/存档/文档/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
I suspect the
viewport
meta tap to resize your site. Try to fix the scale to 1 in the initial, maximum in minimum values.https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
我不知道您是否遇到这种情况,但 iOS 上存在一个错误,即在纵向和横向模式之间切换时比例会发生变化。请参阅 http://www.blog .highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
您可以按如下方式修复它:
将此元标记添加到 HTML 文档的头部:
并将此 JavaScript 添加到页面 - 参见 https://gist.github.com/90129
I don't know if this is what is happening for you, but there is a bug on iOS whereby the scale changes when switching between portrait and landscape mode. See http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
You can fix it as follows:
Add this meta tag to the HTML document's head:
And add this JavaScript to the page - see https://gist.github.com/90129
在 webkit 设备 (Android/iOS) 上,您可以在正文上使用此 CSS,以防止文本在方向更改(旋转)后调整大小。我花了一段时间才找到它。希望它能帮助其他人解决这个奇怪的功能。
On webkit devices (Android/iOS) you can use this CSS on the body to prevent text from resizing after an orientation change (rotation). It took me a while to track it down. Hope it helps others with this odd feature.
这也可能有帮助
This can be also helpful