【问题标题】:Target mobile phones目标手机
【发布时间】:2013-04-02 08:42:06
【问题描述】:

我想使用这样的 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 */
}

手机的正确设置是什么。假设我想避免定位平板电脑和更大的屏幕,而只定位手机?

【问题讨论】:

    标签: javascript css mobile target


    【解决方案1】:

    引用此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
    

    【讨论】:

    • 那为什么不作为副本关闭呢?
    • 此代码是针对屏幕尺寸(实际尺寸)还是屏幕分辨率?它可以是一部非常小的手机,但它可以有一个很大的分辨率!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多