针对移动浏览器进行优化
我有一个在服务器上生成的简单网页。它有简单的文本字段、单选按钮、标签和类似的东西(非常类似于简单的表单)。我正在尝试针对移动浏览器进行优化。我想用尽可能多的 CSS 来完成它,并且我想找到一种支持 iphone、android 和流行的移动操作系统的方法。
我的问题是,我可以设计页面样式,以便字段始终占据手机宽度的 100%、标签将换行等等,但也可以使用户无法放大或缩小并显示缩放比例iphone4 或 iphone3g 是否能正确地查看它?
我已经使用元标记找到了答案的一些部分,但我似乎无法找到一种方法使缩放始终正确,无论分辨率如何。
I have a simple web page that is generated on the server. It has simple text fields, radio buttons, labels and things like that (much resembling a simple form). I'm trying to optimize this for mobile browsers. I'd like to do it in as much CSS as possible, and I'd like to find a way to support iphone, android and the popular mobile OSes.
My question is this, can I style the page so that fields will always take 100% of the width of the phone, labels will wrap,and so on, but also make it so the user cannot zoom in or out and have the scaling appear correctly weather an iphone4 or an iphone3g is looking at it?
I've found bits and pieces of my answer using meta tags, but I can't seem to find a way to make the scaling always right, regardless of the resolution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这对于 iOS 来说效果很好,但在 BlackBerry 和 Android 的横向视图中,页面保持在左侧并且不会放大。我认为如果没有明确设置,这与 iOS 推断高度(和其他属性)有关,而其他平台可能需要
height=device-width
设置。This works great for iOS, but in landscape view of BlackBerry and Android, the page stays on the left and doesn't scale up. I think this has something to do with iOS inferring height (and other attributes) if not explicitly set, while other platforms might need the
height=device-width
set.