适配

<!-- <link rel="stylesheet" media="screen and (max-device-480px)" href="__PUBLIC__/Home/css/iphone.css" /> -->

手机UC浏览器对css media queries 的写法不支持?

例如max-device-width在手机UC里面是无效的,写成max-width就正常,UC浏览器确实有这样的问题,不支持 max-device-width。

其实不需要使用max-device-width, 直接使用max-width即可,但是需要加上2个meta:

<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

<meta name="format-detection" content="telephone=no" />

这样所有浏览器都支持了。

原文地址:https://www.cnblogs.com/fightjianxian/p/9041642.html