Chrome Device Mode Emulation Media Queries Not Working

限于喜欢 提交于 2019-11-28 03:18:17

I fixed this problem by adding a meta tag to my page:

 <meta name="viewport" content="width=device-width">

The accepted answer didn't do it for me, I had to add a minimum-scale=1 as well.

<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />

Device emulation in Chrome is still a WIP. To be honest I think they pushed it to Chrome a little too soon. Try using Canary (the chrome beta browser) to test the emulation, I find that it's working way better than the one in Chrome.

Works for me.

Just put a viewport meta tag in the head section of your page. See example:

 <head>
  <!--include the following meta tag to make chrome dev tools recognize media queries: -->
  <meta name="viewport" content="width=device-width">
</head>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!