简体   繁体   English

媒体查询无法从479px宽度读取到767px?

[英]Media Query not reading from Widths 479px to 767px?

I have three media queries that range like this: 我有三个范围如下的媒体查询:

@media screen and (min-width: 360px) and (max-width: 479px)
@media screen and (min-width: 480px) and (max-width 767px)
@media screen and (min-width: 768px) and (max-width: 1023px)

The issue is that my website doesn't read the styles in the width range of 479px to 767px which is something I do not understand, any assistance with this of suggestions are very much liked, thanks! 问题是我的网站无法读取479px至767px宽度范围内的样式,这是我不了解的内容,对此建议的任何帮助都非常感谢,谢谢!

You have a typo you forgot the colon at the (max-width 767px) it should read like the following: 您有一个错字,您忘记了(max-width 767px)冒号,它的内容应如下所示:

@media screen and (min-width: 360px) and (max-width: 479px)
@media screen and (min-width: 480px) and (max-width: 767px)
@media screen and (min-width: 768px) and (max-width: 1023px)

Here is a snippet 这是一个片段

 @media screen and (min-width: 360px) and (max-width: 479px){ body{background:green;} } @media screen and (min-width: 480px) and (max-width: 767px){ body{background:yellow;} } @media screen and (min-width: 768px) and (max-width: 1023px){ body{background:red;} } 

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

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