Retina iPad Specific CSS

后端 未结 3 1666
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 03:23

I\'m designing a responsive site that will look different on mobile devices. I have three separate media queries in my css plus a query for retina display(s).



        
相关标签:
3条回答
  • 2020-12-08 04:00

    Figured it out.

    I had my iPad Retina query below all other queries but they needed to be above the other queries starting from largest to smallest.

    0 讨论(0)
  • 2020-12-08 04:03

    Try:

    @media only screen 
      and (min-device-width: 1536px)
      and (max-device-width: 2048px)
      and (orientation : landscape)
      and (-webkit-min-device-pixel-ratio: 2) {
          // Retina iPad specific CSS
    }
    
    0 讨论(0)
  • 2020-12-08 04:05

    I had the same problem and I solved using:

    @media only screen and (max-width: 960px), only screen and (max-device-width: 960px) and (-webkit-device-pixel-ratio: 1.5)
    

    For meta viewport I use:

    content="width=device-width; initial-scale=1; maximum-scale=1"
    

    I don't know if this is a perfect solution, but it works.

    0 讨论(0)
提交回复
热议问题