繁体   English   中英

意外的视口媒体查询行为

[英]Unexpected viewport media query behaviour

平板查询正常运行:
@media screen and (min-width: 768px) and (max-width: 1250px)
移动查询就像平板电脑的测量一样运行:
@media screen and (max-width: 426px)

@media screen and (max-width:426px) {
  body {
    background-color: green;
    background-size: cover;
    min-height: 100vh;
    margin: 0px;
  }
}

@media screen and (min-width:768px) and (max-width: 1250px) {
  body {
    background: url("img/backgournd_tablet.svg");
    background-size: cover;
    min-height: 100vh;
    margin: 0px;
  }
}

@media screen and (min-width: 1250px) and (max-width: 2040px) {
  body {
    background: url("img/background1.svg");
    background-size: cover;
    min-height: 100vh;
    margin: 0px;
  }
}

注意:我只是将背景设置为绿色以查看它是否有效,但是当我以移动分辨率编码时没有任何变化。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM