Unwanted padding at bottom of page when input focussed on mobile safari

前端 未结 4 1489
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-15 05:16

I\'m working with textareas on mobile safari and when a textarea is focussed the viewport seems to add padding underneath the document. When inspecting and selecting the area, i

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-15 05:42

    I've answered on another question with same issue.

    But I'll answer it here also:

    body {
      min-height: 100vh;
      min-height: -webkit-fill-available;
    }
    html {
      height: -webkit-fill-available;
    }
    

    -webkit-fill-available;

    makes the "magic"

提交回复
热议问题