input textbox hidden behind keyboard on android Chrome

后端 未结 7 668
梦毁少年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:19

    I found a CSS solution that works very well.

    You can do a css query for a window screen of 300px height o less, that is the mostly screen height of phones with the software keyboard displayed. It works very fast and very well. For example

    @media screen and (max-height: 300px) {
    
        #myinputtext{
            position: absolute; 
            top: 50px;
    
        }
    }
    

提交回复
热议问题