The significance of rem, vw and other adaptation schemes

  • how do I adapt?
    this question many bigwigs have put forward plans, what rem,vw, all kinds of ways to play
  • what do I want to adapt and how do I fit?
    this problem is rarely mentioned by bosses. We didn"t even have a clear goal, so we got a lot of wind and water with all kinds of adaptation plans. There is a sentence on the mobile side, text flow, control flexibility, picture proportional scaling (controls refer to Header components, ListItem of lists, etc.). What are the rules in front of us? I"ve seen a lot of projects, full rem, or vw (except for some styles such as 1px border). So we adapt, that is, we try to scale each element proportionally. So that"s ok?
  • for the end of the second point, each element is proportionally scaled, so I can set viewport to width to 750, and then all the resolutions in it are automatically adapted with px,. What"s the point of doing rem,vw, not to deny his meaning, but to understand his good, good?

Mar.28,2021

750s introduce JS
http://static.leiting.com/lib.
640 designs introduce JS
http://static.leiting.com/lib.https://api-v5.segmentfault.com/question/

use the mobile document header
< meta name= "viewport" content= "width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" > https://api-v5.segmentfault.com/question/

layout can be cut normally
nPX/100
for example: 10px=.1rem https://api-v5.segmentfault.com/question/

as to why it is / 100th
document.documentElement.clientWidth/7.5
OR
document.documentElement.clientWidth/6.4 https://api-v5.segmentfault.com/question/

using REM is mainly based on the font-size of body. The algorithm above is to calculate the font-size, of body and assign it to body
document.documentElement.style.fontSize=document.documentElement.clientWidth/7.5+'px' https://api-v5.segmentfault.com/question/

.
I won't talk about the

plan. It can be found in many places. https://api-v5.segmentfault.com/question/

the aim is to achieve the same display effect on different mobile phones. Because the resolutions of different phones are different, the mainstream ones are 320Compact 360 and 375, and the non-mainstream ones are 432 and so on, so it's troublesome to make a set of effects for all the resolutions, and it's not possible to have a little more here and a little less there, so use the debut of Slack Off to save work. https://api-v5.segmentfault.com/question/

in fact, I don't support this practice, let's not talk about it. https://api-v5.segmentfault.com/question/

as for what you said about viewport=750, I don't think so. You can give it a try. https://api-v5.segmentfault.com/question/


remember that the lower version of Android is not compatible.
after the phone is rotated, the
page will not take effect if it is put into app. https://api-v5.segmentfault.com/question/


https://api-v5.segmentfault.com/question/

https://api-v5.segmentfault.com/question/

the rem solution of the https://codeshelper.com/a/1190000014502172?share_user=1030000013689544"> front-end mobile adaptation solution.

it is necessary to adapt on the mobile end. If you embed app, many copycat phones do not support rem very well. https://api-v5.segmentfault.com/question/

Menu