min-width media query not working on ipad?

后端 未结 6 818
被撕碎了的回忆
被撕碎了的回忆 2021-02-05 20:43

Why isnt the following media query being picked up on iPads in landscape mode?

@media all and (min-device-width: 1000px) {
    css here
}

Or

6条回答
  •  忘掉有多难
    2021-02-05 21:26

    Trying to write a media query for tablet, I actually encountered the problem of the iPad underreporting its dimensions. When I tried to use @media screen and ( min-width: 768px ), my styles were being applied to other tablet devices, but ignored by the iPad. I started playing around with the Responsive device model in developer tools, and I stumbled onto the solution. For some reason, my styles would apply when I sized the screen down to 760px. So, I edited the media query to read @media screen and ( min-width: 760px ) and everything started working as expected.

提交回复
热议问题