Mobile terminal screen Adaptive Layout and screen Adaptive Layout

Source: Internet
Author: User

Mobile terminal screen Adaptive Layout and screen Adaptive Layout

1. Technical Points

It is suitable for mobile terminal auto-Scaling to adopt a percentage layout. Note that the percentage of height is based on the parent element.WidthCalculated because the width of the parent element on the Mobile End is sometimes not specified (for example, if the width of the parent element is 100%), the height of the child element is 0.

Therefore, the height of the child element is supported by padding-top or padding-bottom.

At the same time, the height is set to 0 to prevent the font-size or line-height attributes from affecting the height.

2. Example

In this example, three images are displayed in each row. The image width in each column is 33%, and the image spacing is 0.5%.

<! DOCTYPE html> 

Effect:

 

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.