简体   繁体   English

iPad上基于百分比的CSS布局中断

[英]percent based CSS layout breaks on iPad

I'm trying to code a site to a customer's specifications. 我正在尝试按照客户的规范对网站进行编码。 What I have now seems to be working perfectly on OSX Safari, Firefox, and Chrome. 我现在所看到的在OSX Safari,Firefox和Chrome上运行良好。 Untested on PC. 未经PC测试。 Breaks quickly on iPad. 在iPad上快速中断。 And is completely borked on iPhone. 并且在iPhone上完全感到厌烦。

Here's where I'm at now: http://geofkern.com/14v0.1/jewelrySeries.html 这是我现在的位置: http : //geofkern.com/14v0.1/jewelrySeries.html

Every element is percentage sized to the height of the window because the client is used to flash sites that scale to window size and wants his images to display as large as possible. 每个元素的大小均以窗口高度的百分比表示,因为客户端用于刷新可缩放至窗口大小的站点,并希望其图像显示尽可能大。 On iPad iff I open the page in landscape mode, and click the menu button immediately, the menu pops up, and everything is displayed at the proper size. 在iPad上,如果我以横向模式打开页面,然后立即单击菜单按钮,弹出菜单,并且所有内容均以适当的大小显示。 But once I scroll, reload, or try to view in portrait orientation, the menu button stops working or nothing displays at the right size (if it's even still visible). 但是,一旦我滚动,重新加载或尝试以纵向查看,菜单按钮就会停止工作,或者没有以正确的大小显示任何内容(即使它仍然可见)。 I've tried changing viewport meta settings but no combination seems to work. 我尝试过更改视口元设置,但似乎没有任何组合有效。 I'd love to leave it scalable, but the percentage based sizes seem to go wonky at any scale other than 1.0. 我很想让它保持可伸缩性,但是基于百分比的大小似乎在除1.0之外的任何比例上都变得怪异。

Is there something obvious that I'm missing here? 有什么明显的我想念的地方吗? Is there a better way to be doing this? 有没有更好的方法可以做到这一点? Does anyone see why my page is displaying so erratically on mobile devices? 有人看到我的页面为什么在移动设备上如此不稳定地显示吗?

So it looks like the biggest problem is that viewport relative units aren't yet supported by iOS. 因此,似乎最大的问题是iOS尚不支持视口相对单位。 Changed them all back to % units, and most of my issues have cleared up. 将它们全部改回了%单位,我的大多数问题都已解决。 Still isn't quite behaving like on desktop, but at least it's no longer "completely borked". 仍然不太像在台式机上那样,但是至少它不再“完全无聊”。

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

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