How to set viewport only for iphone or ipad?

后端 未结 8 977
忘了有多久
忘了有多久 2021-02-01 07:38

I have a website that needs to use 0.3 value for viewport on iphone, but 0.7 for ipad.

Is there a way to set viewport for only iphone or ipad?

相关标签:
8条回答
  • 2021-02-01 08:34

    Please note, meta viewport is comma-delimited list, you should not use semicolons.

    <meta name = "viewport" content = "width = 320,
           initial-scale = 2.3, user-scalable = no">
    

    Source: viewport syntax in Apple's documentation and Configuring the Viewport – Apple article

    (If I had more reputation points, I would add this as a comment)

    0 讨论(0)
  • 2021-02-01 08:34

    See my answer below on how to dynamically set your initial-zoom so that your entire site is zoomed correctly on page load (works for all device sizes).

    Change tablet viewport to exactly show fixed dimension element

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