媒体查询不适用于桌面 [英] Media Queries not working on desktop

查看:87
本文介绍了媒体查询不适用于桌面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的媒体查询存在一个奇怪的问题。他们似乎在我的移动设备上工作得很好,但是当我调整桌面浏览器的大小时,不会应用更改。这使得使用web inspector / firebug无法检查我的移动样式。以下是我的媒体查询:

  @media屏幕
和(min-device-width:320px)
和(max-device-width:480px){}


解决方案

您正在致电特定设备查询。如果你想在浏览器窗口调整大小,你需要从最小和最大呼叫中删除 -device -



@media仅屏幕
和(min-width:320px)
和(max-width:480px){}


I am having a strange problem with my media queries. They seem to be working just fine on my mobile devices, but when I resize my desktop browser the changes are not applied. This makes using web inspector/firebug impossible to inspect my mobile styles. Here is my media query:

@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px) {} 

解决方案

You are calling device specific queries. If you want to test on browser window resize, you need to remove -device- from both min and max calls.

@media only screen and (min-width: 320px) and (max-width: 480px) {}

这篇关于媒体查询不适用于桌面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆