简体   繁体   English

媒体查询无效

[英]Media queries won't work

I have this simple media queries: 我有这个简单的媒体查询:

@media screen and (min-width: 1440px) and (max-width: 1600px) {

   body {
      font-size: 14px;
   }

}

But this just doesn't work. 但这只是行不通。 My screen resolution is 1600x900, so it should work, I think. 我的屏幕分辨率是1600x900,所以它应该可以工作,我想。 What the hell is wrong here? 这到底有什么不对吗? I put this on the end of .css file, I added 我把它放在.css文件的末尾,我补充说

<meta name="viewport" content="width=device-width,initial-scale=1.0">

to the HTML file... I don't know what else should i do to make this working. 到HTML文件...我不知道我还应该做些什么来使这个工作。

min-width and max-width refer to the width of the window , not of the screen . min-widthmax-width指的是窗口的宽度,而不是屏幕的宽度。 @media screen means that the styles apply to the "screen" medium (as opposed to the "print" medium for example). @media screen表示样式适用于“屏幕”媒体(例如,与“打印”媒体相对)。

To target the resolution, you can use min-resolution and max-resolution . 要定位分辨率,您可以使用min-resolutionmax-resolution

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

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