Home  >  Q&A  >  body text

css3 - 求教个问题,关于响应式布局,跟ipad有关,媒体查询失效?

大家好,我说下我的情况。
ipad的像素是1024*768,我使用媒体查询
@media only screen and (max-width:1024px) {css代码}
为何在谷歌浏览器模拟后,css代码正确执行, 而在ipad设备上运行却无效?
还是说有其他更好的方法能让一个页面在ipad上浏览的时候,就能适应ipad的宽度?谢谢!

PHP中文网PHP中文网2766 days ago471

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-04-17 11:28:03

    Checked it, it was my mistake. It should be solved using min/max-device-width/height.

    reply
    0
  • 迷茫

    迷茫2017-04-17 11:28:03

    It is enough to add this sentence, no need for max-device-width/height:

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

    reply
    0
  • Cancelreply