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

前端 未结 4 1535
眼角桃花
眼角桃花 2021-02-15 05:18

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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-15 05:32

    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"

提交回复
热议问题