media query pixel-density and max-width together

后端 未结 2 1924
清酒与你
清酒与你 2021-01-13 05:46

I\'m trying to create a rule that includes/excludes based on both max-width and device-pixel-ratio. An example would be if I want the Kindle Fire @ 600px to be excluded, but

2条回答
  •  爱一瞬间的悲伤
    2021-01-13 06:19

    Use mediaqueries like this example for iPad with Retina display.

    @media only screen 
    and (min-device-width : 768px) 
    and (max-device-width : 1024px) 
    and (orientation : portrait)
    and (-webkit-min-device-pixel-ratio: 2) { /* STYLES GO HERE */ }
    

提交回复
热议问题