提示用于优化一个网站,Android的浏览器? [英] Tips for optimizing a website for Android's browser?

查看:162
本文介绍了提示用于优化一个网站,Android的浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找提示,技巧和资源优化网站设计,Android的浏览器。

I'm looking for tips, tricks and resources on optimizing a website design for Android's browser.

我要建一个Android应用程序和一些功能将通过Web界面进行访问。

I'm building an Android app and some of the functionality will be accessible through a web interface.

推荐答案

我靠两个元素来优化移动浏览器的网站(特别是Android和iPhone):

I rely on two elements to optimize websites for mobile browsers (especially Android and iPhone):

一般我想页不要有800至900个像素的页宽,作为Android和iPhone浏览器将其设置为默认。要使页面宽度一样的设备宽度,我设置以下meta标签:

Usually I want pages not to have a page width of 800 to 900 pixels, as the Android and iPhone browsers set it to by default. To have the page width the same as the device width, I set the following meta tags:

<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" />

CSS媒体查询

我适应设计到页面宽度。例如,具有2列的内容为大屏幕和1列的小屏幕和打印。所以,我包括到主主css文件进一步CSS-包括与媒体查询:

CSS media queries

I adapt the design to the page width. For instance, having a 2 column content for large screens and 1 column for small screens and print. So I include into the main main css-file further css-includes with media queries:

@import url(style-screen.css) screen;
@import url(style-small.css) print, handheld;
@import url(style-large.css) screen and (min-width: 801px);
@import url(style-small.css) screen and (max-width: 800px);

这篇关于提示用于优化一个网站,Android的浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆