How do you adapt to the mobile terminal at present?

at present, what adaptation scheme is used for web mobile developers? almost all the solutions given by major forums are to set up viewport, and then use rem layout. However, Taobao lib-flexible has started to propose to use vh and vw, but there is no such website in use. So how do you adapt to the mobile terminal now?

Aug.31,2021

rem scheme is used more often, which is mainly easy to control and easy to calculate. Vw.vh is also useful. Generally speaking, only integer percentages of viewport (width or height) length (such as 25% or 50%) are occasionally used in scenarios, because the percentage will have some errors due to decimals in calculation. In addition, when the aspect ratio of adaptive models is different, the unified use of percentages will cause distortion and other problems, so the actual use is not much.
before writing more graphics of H5, but also used js overall zoom and SVG two programs, mainly the page container is independent of the viewport, in the case of ensuring that the aspect ratio is consistent with the design draft, allow the page to slightly overflow or retain black edges. The difference between the two schemes is that the former uses js to set the style to violently zoom, while the latter borrows SVG's own viewport zoom, with ps script to automatically cut the image to do automatic page output.


generally use lib-flexible


generally use rem , and then uniformly modify the font size of the root node according to the media query, so that you can adapt to various screen sizes


rem+flex layout. Of course, it is also possible to use vh+vw


use rem to complete the adaptation of mobile terminal


many big manufacturers use this: https://github.com/imochen/ho.

.
Menu