3 media queries for iphone portrait, landscape and ipad portrait

前端 未结 5 2090
北海茫月
北海茫月 2021-02-01 11:22

I have tried the different combinations of width & device-width but on the iPhone in landscape this code never turns the background red;

I

5条回答
  •  臣服心动
    2021-02-01 12:06

    Take a look at this resource, will give you media queries for pretty much everything http://arcsec.ca/media-query-builder/ , you need to be be specifying a min width aswell. also less of the !important, dirty :)

    in your case

    @media only all and (min-device-width: 320px) and (max-device-width: 480px) {
    /* insert styles here */
    }
    

提交回复
热议问题