2013-04-02 27 views
1

我想要的目標使用CSS媒體查詢這樣的移動設備:目標手機

@media (min--moz-device-pixel-ratio: 1.5), 
     (-o-min-device-pixel-ratio: 3/2), 
     (-webkit-min-device-pixel-ratio: 1.5), 
     (min-resolution: 1.5dppx) { 

    /* your retina rules here */ 
} 

什麼是對手機進行正確的設置。假設我想避免將目標鎖定到平板電腦和更大的屏幕,並且只鎖定手機?

回答

3

報價從這個answer

min-width: 320px // smartphones, iPhone, portrait 480x320 phones 
min-width: 481px // portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. 
min-width: 641px // portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 and 854x480 phones 
min-width: 961px // tablet, landscape iPad, lo-res laptops ands desktops 
min-width: 1025px // big landscape tablets, laptops, and desktops 
min-width: 1281px // hi-res laptops and desktops 
+0

爲什麼不親如重複的,然後呢? –

+0

此代碼是針對屏幕尺寸(實際尺寸)還是屏幕分辨率?它可以是一個非常小的手機,但它可以有一個很大的解決方案,例如! – Jacob

+0

此代碼在我的設備上失敗! – Jacob