如何正确构建Android兼容网站?
我是 HTML/CSS/jQuery 编码员。我需要开发网站,该网站将“缩小”或“适合”320x480(常用分辨率)Android 移动设备屏幕。 或者甚至这个解决方案应该检查我的屏幕分辨率并为此连接正确的 CSS。 我在某个地方遇到了 android.js 文件,它连接到 HTML 并识别该网站是否在 PC 或 Android 设备上打开。但我一点也不确定。我之前没有为手机做过任何事情。
找到这篇文章:http://blog.mgpwr。 co.uk/2010/09/make-your-website-iphone-兼容/ 不认为使用 PHP 是一个正确的解决方案。 更好的是 HTML 或 JS。
I am HTML/CSS/jQuery coder. And I need to develop the website, which will be "zoomed-out" or "fitted" to 320x480 (frequently used resolution) Android mobile device screen.
Or even this solutions should check my screen resolution and connect the right CSS for that.
Somewhere I met that there is android.js file, which connects to HTML and recognizes if the website was open on PC or on android device. But I am not sure at all. I didn't do anything for mobiles before.
Found this article: http://blog.mgpwr.co.uk/2010/09/make-your-website-iphone-compatible/
Don't think it's a right solution to use PHP for that.
Better would be HTML or JS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一个非常简单的答案是不要对元素的宽度进行硬编码,也不以像素为单位指定字体大小。移动浏览器将自行调整呈现的页面。
但是,如果您想要更多类似 iPhone 的表单控件外观,例如单选按钮、按钮、下拉菜单,那么您需要使用其他答案中概述的移动 javascript 库。
A very simple answer would be don't hardcode width on the elements and don't specify font size in pixels. The mobile browser will adjust the rendered page itself.
If however you want more iPhone-like look of form controls like radio buttons, buttons, drop downs, then you need to use the mobile javascript libraries outlined in the other answer.
一个简单的答案是移动 JavaScript 库,例如以下之一:
http://www.sencha。 com/products/touch/
http://www.phonegap.com/home/
http://jquerymobile.com/
http://jqtouch.com/
A simple answer would be a mobile javascript library such as one of the following:
http://www.sencha.com/products/touch/
http://www.phonegap.com/home/
http://jquerymobile.com/
http://jqtouch.com/