Detect Xoom browser (Android)

独自空忆成欢 提交于 2019-12-23 04:10:14

问题


How can I detect the Motorola Xoom browser with CSS Media?

e.g. for iPad, I use @media only screen and (device-width:768px)

What is the similar media query for the Motorola Xoom browser?


回答1:


@media only screen and (min-device-width: 800px) and (max-device-width: 1280px) { … }

See: http://webdesign.about.com/od/css3/a/css3-media-queries.htm




回答2:


The screen resolution is 1280x800, so the width is either 1280 or 800:

@media only screen and (device-width:800px)

or

@media only screen and (device-width:1280px)

So you can also use other layout depending on the device orientation.

Although, i wouldn't just rely on the device width. If you really want to detect the Xoom browser, your only possibility is to look at the user agent string, because there are many screens having this dimensions. For my websites i don't use special tablet versions, the tablet browsers are so good, they don't need extra care (unlike IE ;)). For my websites I design normal and mobile versions.



来源:https://stackoverflow.com/questions/5762734/detect-xoom-browser-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!