2013-04-02 31 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