Virtual keyboard impact layout for mobile input

Source: Internet
Author: User

Mobile layouts often use absolute positioning (absolute) and fixed positioning (fix) to lay out a layer. Then there will be some information on this layer, when the layer above is input, the mobile input information will pop up the virtual keyboard, which will affect our layout, bring us trouble. Often encountered but rarely tidy, again met again confused, take advantage of this time, I test the success of my methods recorded. Specific to see their own application, purely personal test.

Case one, a layer written in absolute (class named Elayer), the layer is set with the background color, and then the layer above the layout has input. When the input soft keyboard pops up, the layer moves upwards with the background, and then there is a portion of the space below, with the default color not the background color set. The original settings are as follows:

. Evallayer {position:absolute; width:100%; height:100%; background:rgb (81,79,97); top:0; Left:0; z-index:One;}

Resolved as follows:

. Elayer {position:absolute; width:100%; min-height:100%; Bottom:0; background:rgb (81,79,97); top:0; Left:0; z-index:one; overflow-y:auto;}

In subsequent updates

  

Virtual keyboard impact layout for mobile input

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.