Media Query not working for iPhone and iPad

前端 未结 2 890
终归单人心
终归单人心 2021-01-22 19:34

@media query is not working in case of iPhone 5 and iPad 4 OS. I have used following CSS for styling each OS and device for di

2条回答
  •  长情又很酷
    2021-01-22 20:05

    The reason is because the new Apple devices have a higher pixel ratio density. You should put this meta tag in the head of your document and your media queries will work everywhere:

    
    

    By the way, the higher pixel ratio for the new apple products is called "retina display."

    If you do have access the iPhone, ipad, etc... try viewing this website:

    http://mattstow.com/viewport-size.html

    on those devices to see the viewport size of the device. Then, add the meta tag, and you will see that the viewport size changes.

提交回复
热议问题