2011-11-24 57 views
2

我一直在做一些移動web應用程序測試,並已注意到,htc願望高清屏幕圖像似乎都模糊,表明對我來說這個屏幕的像素比例是2,與iPhone 4相同。我已將所有在我的(-webkit-min-device-pixel-ratio:2)媒體查詢中更新的x2圖像是爲了克服至少iphone 4的這個問題,但是我很驚訝這個願望並沒有挑選出來嗎?有什麼我在這裏失蹤?htc desire hd無法啓動(-webkit-min-device-pixel-ratio:2)媒體查詢?

 @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) { 

    /* Social Icons */ 
    #social-icons{margin:40px 0;} 
    #social-icons li{margin-bottom:5px;} 
    #social-icons li a{background: url(../img/social-sprite-x2.png); background-position: 0 0; background-repeat: none; background-size: 63px auto; display:block; text-indent: -999em; overflow:hidden; width:63px;height:63px;} 

    #social-icons li a.fb{background-position:0 0;} 
    #social-icons li a.tw{background-position:0 -75px;} 
    #social-icons li a.ms{background-position:0 -150px;} 
    #social-icons li a.tn{background-position:0 -226.5px;} 
} /* //End Retina **********************************/ 

這是否意味着,只有iPhone 4採用這種媒體查詢?

凱爾

回答

2

我知道我是一個有點晚就這一個聚會,但除了上面給出的正確答案,這裏是CSS,我使用的時刻來處理這些HD設備:

@media 
only screen and (-webkit-min-device-pixel-ratio: 1.5), 
only screen and (-moz-min-device-pixel-ratio: 1.5), 
only screen and (min-device-pixel-ratio: 1.5) { 

/* Your styles here. */ 

} 

只希望這有助於未來的人。乾杯!

+1

謝謝。我很確定你的意思是-moz-min-device-pixel-ratio,所以我改變了它。 –

+0

是的,我做到了!謝謝。 –