首页 文章

针对三星s6的CSS媒体查询

提问于
浏览
9

请帮忙 . 任何机构都可以告诉我有关三星s6的CSS中的媒体查询更具响应性吗?

@media only screen and 
(min-device-width : 360px) and 
(max-device-width : 640px) and 
(-webkit-min-device-pixel-ratio : 3) { // code here }

从哪里可以测试三星s6的响应式设计?有任何在线链接或工具吗?

3 回答

  • 2

    我试过这个:

    @media screen 
      and (device-width: 360px) 
      and (device-height: 640px)
      and (-webkit-min-device-pixel-ratio : 4) 
      and (-webkit-device-pixel-ratio : 4)
      and (orientation: portrait) {
    
    /* CSS GO HERE */
    
    }
    

    它是's seems to work. For S6 and S7. I think it'因为三星S6和S7尺寸是1440x2560:

    1440/4 = 360
    2560/4 = 640

    希望这有帮助 .

  • 4

    Chrome开发工具可让您在不同的屏幕尺寸上测试查询 . 打开开发人员控制台(F12),然后单击“切换设备模式”按钮(小屏幕图标) . 您可以自行选择设备或手动设置屏幕尺寸 . 对于星系S6,尺寸为360x640 .

  • 1

    我建议你使用以下代码:

    /* Samsung Galaxy S6, S6+, S7, S7+ | 1440×2560 pixels ----------- */
    /* Portrait and Landscape */
    @media screen and (device-width: 360px) and (device-height: 640px) and (-webkit-device-pixel-ratio: 4) {
        /* Styles */
    }
    
    /* Landscape */
    @media only screen and (min-device-width: 360px) and (max-device-height: 640px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 4) {
        /* Styles */
    }
    
    /* Portrait */
    @media only screen and (min-device-width: 360px) and (max-device-height: 640px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 4) {
        /* Styles */
    }
    

    如果您锁定完整列表,请查看link,您将找到以下设备:智能手机,iPad,iPad 3,iPhone 4,iPhone 5,iPhone 6,iPhone 6,三星Galaxy S3,三星Galaxy S4,三星Galaxy S5 ,三星Galaxy S6,三星Galaxy S7,三星Galaxy S8,三星Galaxy S9

    欲了解更多信息,请查看link并查看link

相关问题