Two schemes of screen adaptation, super detailed
Rem-based adaptation scheme What is rem? rem refers to the unit of the font size relative to the root element. In the daily development process, we usually set the font of the root element (html/body) to 10px, which is convenient for us to calculate (at this time, 1rem of the child element is equivalent to 10px) . Applicable scene A web application with an unfixed aspect ratio, suitable for most business scenarios Project combat 1. install dependencies npm i postcss-pxtorem autoprefixer amfe-flexible --save-dev postcss-pxtorem is a plug-in for PostCSS, which is used to generate rem units from pixel units. autoprefixer browser prefix processing plug-in amfe-flexible scalable layout scheme replaces the original lib-flexible and selects viewport compatible with many current browsers 2. Create a postcss.config.js file in the project root directory module .exports = { plugins : { autoprefixer : { o...