Media query ipad vs iphone4

后端 未结 5 1112
别跟我提以往
别跟我提以往 2020-12-28 08:47

I am using the media query in css to differentiate iphone and ipad

Here\'s my code:

/* iphone 3 */
@media only screen and (min-device-width : 320px)          


        
5条回答
  •  醉梦人生
    2020-12-28 09:10

    Check out http://css-tricks.com/snippets/css/media-queries-for-standard-devices/

    /* iPhone 4 ----------- */
    @media
    only screen and (-webkit-min-device-pixel-ratio : 1.5),
    only screen and (min-device-pixel-ratio : 1.5) {
    /* Styles */
    }
    
    /* iPads (portrait) ----------- */
    @media only screen
    and (min-device-width : 768px)
    and (max-device-width : 1024px)
    and (orientation : portrait) {
    /* Styles */
    }
    

提交回复
热议问题