2013-01-08 38 views
2

我测试的iPad的(1,2)我的web应用程序以及三星Tab键2。我有不同的CSS集(外部)要应用于iPad上的横向/纵向模式和标签2上的横向/纵向模式。媒体查询为iPad(横向)适用于三星Galaxy Tab 2(风景)以及

但我无法为Tab 2写入正确的媒体查询。与我的喜好相反,将应用于iPad横向的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" /> 

注:我。 根据规格,Samsung Tab 2的分辨率为1024x800。

ii。 由于iPad(1)也具有相同的值,因此我无法使用表2中的min-device-pixel-ratio : 1

回答

3

最后我这是怎么实现的吧:

<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" /> 
<link rel="Stylesheet" type="text/css" media="only screen and (device-width : 1024px) and (orientation : landscape)" 
    href="CSS/TabLandscape.css" /> 
<link rel="Stylesheet" type="text/css" media="only screen and (device-width : 600px) and (orientation : portrait)" 
    href="CSS/TabPortrait.css" /> 

原来,三星标签2(P3100),它拥有1024x800的分辨率,在人像模式(Android的股票浏览器)相匹配,以device-width: 600px

+0

谢谢你。我在努力寻找正确的查询。 – Leah