On the front end of adaptation issue

rem adaptation scheme

Before vw out of the program, the public is most acceptable scheme rem adapting, because rem meet the above said, can be a global benchmark units.

rem (font size of the root element ), the  Level 3 CSS Values and Units Module in the definition is to set the difference between the font size, and em (font size of the element) based on the root element of the page is, em according to its the parent element to set the font size, and font size rem is set according to the web page with the elements (html).

  1. After the dynamic modification of the Viewport there are certain risks, such as by changing the Viewport Scaling page, acquired  innerWidth/innerHeight will also change, if the business logic has access to this aspect perform other calculations may result in unexpected errors ;

Today, in fact, there is a lot of variety in rem evolved on the basis of flexible solutions, and some will not Viewport scaling processing, processing 1px border problems yourself.

  1. flexible / hotcss are not pure CSS scheme, the need to introduce some Javascript code
  2. rem is not designed to solve these problems, how many fit the width of the page there is a hack feeling with rem
  3. There are some compatibility issues for the Android 4.4 version of the system does not support viewport scaling (when, of course, flexible treatment Android series, have always believed that dpr 1, no viewport zoom)

Guess you like

Origin www.cnblogs.com/lhqdbk/p/11468439.html