2013-01-08 40 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