Mobile-font-size Adaptation Scheme (cont.)

Source: Internet
Author: User

Overview

Previously wrote a mobile font-size adaptation scheme, but in the course of practice, still found that the thinking is too limited, the field of vision is too narrow, so now add updates, recorded, for later development of reference, I believe that other people also useful.

I have 2 main mistakes in my last blog post, and I'll write down each one below.

This blog post refers to the mobile-side adaptation scheme (below).

Adaptation Program

There are a variety of adaptation options:

    1. percent Layout : fixed height, width adaptive. Is the fixed height, the width in percent. As you can imagine, for different screens, everything has a transverse stretch, which makes it very difficult to see.
    2. px Layout : Fixed width, viewport zoom. Is all with PX, and then use JS to control the Initial-scale scale. This way the pages are scaled as a whole on different screens.
    3. rem Layout : REM Does the unit of measurement, changing font-size.

It should be noted that if only the overall zoom of the page is reduced, the effect of Method 1 and Method 2 is the same !!!

Adaptation purposes

As I said before, the purpose of our adaptation is: for different screens, the page needs simply to zoom in or out. For this purpose, the above methods 2 and 3 can achieve the effect.

But, instead of just looking for wider fonts or larger pages, humans have invented a wider range of devices, rather than looking for more beautiful layout content . And that's the essence of the response: show different content to others depending on the size of the screen !

So from this point of view, Method 2 is far from enough, so we need Method 3, the advantage of 2:

    1. Can be combined with REM and PX to achieve partial content size unchanged!
    2. You can use the REM response to show different layouts for different sizes of screens!

At present I only understand the method 3 this extent, Method 3 has a limitation, that is, the DPR can not be well adapted, so if there is a better compatibility with the DPR scheme, I will remember.

Mobile-font-size Adaptation Scheme (cont.)

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.