Disable zoom on input focus in Android webpage

后端 未结 30 1237
日久生厌
日久生厌 2020-12-02 05:17

Here\'s the dilema, I have a webpage (only for android devices) and in that page I have an input box (a text box specifically) and when it gets focus the browser zooms in. I

30条回答
  •  Happy的楠姐
    2020-12-02 06:15

    You need 2 things:

    Use a metatag like this in your head to avoid the user from zooming:

    
    

    And then in your css put something like the following to avoid the browser from zooming:

    * { font-size:16px; }
    

    Done! I think the browser resizes your viewport based on the smallest font or something like that. Maybe someone could explain it better, but it worked :)

提交回复
热议问题