问题
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