Media Queries not working on desktop

2019-05-31 23:00发布

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) {} 

1条回答
啃猪蹄的小仙女
2楼-- · 2019-05-31 23:21

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) {}

查看更多
登录 后发表回答