Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 媒体查询无法使用视口初始比例0.25_Html_Css_Media Queries - Fatal编程技术网

Html 媒体查询无法使用视口初始比例0.25

Html 媒体查询无法使用视口初始比例0.25,html,css,media-queries,Html,Css,Media Queries,视区 @media screen and (max-width: 480px){ .navPosFixed{position:inherit !important; border:red solid 1px;} } if(navigator.userAgent.match(/Android/i) ||navigator.userAgent.match(/Windows Phone/i) ||navigator.userAgent.match(/webOS/i) ||navigator.us

视区

@media screen and (max-width: 480px){
.navPosFixed{position:inherit !important; border:red solid 1px;}

}

if(navigator.userAgent.match(/Android/i)
||navigator.userAgent.match(/Windows Phone/i)
||navigator.userAgent.match(/webOS/i)
||navigator.userAgent.match(/iPhone/i)
||navigator.userAgent.match(/iPod/i)
||navigator.userAgent.match(/BlackBerry/i)
||navigator.userAgent.match(/iemobile/i)){
文件。写(“”);
}
虽然页面的初始缩放比例为1.0,但工作正常,但一旦更改为0.25,它将忽略媒体查询。
我想缩小页面并运行移动设备的媒体查询

一旦初始比例设置为0.25,视口宽度等于480/0.25=1920。 因此,修改css代码如下所示:

@媒体屏幕和(最大宽度:1920像素){
.navPosFixed{position:inherit!重要;边框:红色实心1px;}
}


顺便说一句,一些android浏览器在初始比例不等于1时不工作。

当然,让页面“缩小”和“运行媒体查询”是违反直觉的?有什么解决方案吗?让
让你的媒体查询工作。我不明白你为什么要缩小页面并同时进行媒体查询?使用缩小的原因是我们有几个页面无法对移动做出响应,因为我们使用了所有网格的%宽度使其流动。因此,在移动设备中,它打破了布局。我想使用媒体查询来覆盖css属性,以解决问题。老实说,听起来非常复杂
<script>
if(navigator.userAgent.match(/Android/i)
        || navigator.userAgent.match(/Windows Phone/i) 
        || navigator.userAgent.match(/webOS/i) 
        || navigator.userAgent.match(/iPhone/i)
        || navigator.userAgent.match(/iPod/i) 
        || navigator.userAgent.match(/BlackBerry/i) 
        || navigator.userAgent.match(/iemobile/i)) { 
        document.write('<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=0.25" />'); 
        }
</script>