【发布时间】:2012-12-22 00:10:05
【问题描述】:
我正在 iPad(1,2) 以及 Samsung Tab 2 上测试我的网络应用程序。我有不同的 CSS(external) 集应用于 iPad 上的横向/纵向模式和选项卡 2 上的横向/纵向模式。
但我无法为 Tab 2 编写正确的媒体查询。与我的喜好相反,要应用于 iPad Landscape 的 CSS 也适用于 Tab 2 的横向模式!
这是我尝试过的:
<link rel="Stylesheet" type="text/css" media="only screen and (min-device-width : 600px) and (max-device-width : 1024px) and (orientation : landscape)"
href="CSS/TabLandscape.css" />
<link rel="Stylesheet" type="text/css" media="only screen and (min-device-width : 600px) and (max-device-width : 1024px) and (orientation : portrait)"
href="CSS/TabPortrait.css" />
<link rel="Stylesheet" type="text/css" media="only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape)"
href="CSS/iPadLandscape.css" />
<link rel="Stylesheet" type="text/css" media="only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait)"
href="CSS/iPadPortrait.css" />
注意: i. 根据规格,三星 Tab 2 的分辨率为 1024x800。
二。 我不能将min-device-pixel-ratio : 1 用于 Tab 2,因为 iPad(1) 也具有相同的值。
【问题讨论】:
标签: css media-queries