【发布时间】:2012-01-06 11:23:42
【问题描述】:
您好,我正在使用多种平板设备、iPad、Galaxy Tab、Acer Iconia、LG 3D Pad 等。
- iPad - 1024 x 768
- LG 平板 - 1280 x 768
- Galaxy Tab - 1280 x 800
我只想使用 CSS3 媒体查询来定位 iPad。因为,LG 和 iPad 的设备宽度是相同的 768 像素 - 我无法分离每个设备。
我尝试过以下分离,但似乎不起作用:
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation : portrait) /* applied to lg also */
@media only screen and (min-resolution: 132dpi) and (max-device-width: 1024px) and (orientation : portrait) /* applies to lg also */
@media only screen and (device-aspect-ratio: 1024/768) and (orientation : portrait) /* does not work on iPad or LG */
我不知道 iPad 的 -webkit-device-pixel-ratio 和其他 -webkit* 选项及其值。我不想将 JavaScript 用于样式,有什么想法吗?
【问题讨论】:
-
device-aspect-ratio 可以在 iPad 上使用,但正确使用的值是 768/1024
标签: ipad css webkit media-queries