input textbox hidden behind keyboard on android Chrome

后端 未结 7 669
梦毁少年i
梦毁少年i 2020-12-13 13:49

I have a mobile web page of the following format:

header - logo etc - absolute positioned

content - scrollable, absolute positioned

footer, 40px abs

7条回答
  •  心在旅途
    2020-12-13 14:11

    Changing from absolute positioning to fixed positioning should fix the issue. Absolute positions the element with respect to the initial page-size during page load (adding a keyboard shrinks the visible page). Fixed positions the element with respect to the current page-size, keeping the element above the keyboard.

    #myElement {
      position: fixed;
      bottom: 2em;
    }
    

提交回复
热议问题