大家讲道理2017-04-17 13:49:24
It is recommended to use rem to layout according to the font-size set in HTML. If the width sent upstairs is not that wide or narrower than it, the user will not be able to see the full screen or swipe to see the current one-screen interface.
迷茫2017-04-17 13:49:24
It is recommended to use rem layout, set font-size on the root element, and then perform conversion based on the font-size according to the proportion of the design drawing.
大家讲道理2017-04-17 13:49:24
There is no benefit in hard-coding the size, and the display effect is not good on a large screen
PHP中文网2017-04-17 13:49:24
I always write like this. The advantage is that it is easier to write weird pages. The disadvantage is that I have found that the text on the page displays in different sizes on different mobile phones
And it is best to define the screen width in conjunction with js for better compatibility
高洛峰2017-04-17 13:49:24
Of course there are problems. The width of the design draft is generally enlarged by 2 times. If the requirements are not high, it is generally sufficient to reduce the size. If there are many compatible machines, it is recommended to use rem. Dynamically set dpr and font-size for different machines, and then restore the design draft. For details, refer to Solutions from Taobao flexbox or NetEase