Media Queries - CSS only for iPhone landscape

后端 未结 4 1985
抹茶落季
抹茶落季 2021-02-01 22:59

Are the same methods used to write CSS only for iPhone in landscape mode?

4条回答
  •  再見小時候
    2021-02-01 23:16

    actually if you use :

    
    

    then you prevent user to zoom at any time, which can cause usability problems.

    I would recommand you to use :

    
    

    In this case, you force your page to be displayed at it's original initial scale, and so then you can target different layout sizes with your media queries, as the layout will be resized when you will rotate your iPhone :

    @media only screen and (min-width: 480px) {
        /* landscape mode */
    }
    
    @media only screen and (max-width: 479px) {
        /* portrait mode */
    }
    

    And the user can still pinch the page to zoom.

提交回复
热议问题