当前位置: 首页 > Web前端 > HTML

PC端,125%?显示问题解决方案

时间:2023-03-27 23:06:21 HTML

已经开发了很多年,我一直在使用100%的以下设置。PC端的px+%计算基本没问题。但是领导和客户都喜欢125%的设置,真是醉死我了。现在想办法。1、先考虑rem。2.安装插件。npminstallamfe-flexible@2.2.1-Snpminstallpostcss-pxtorem@5.1.1-D//版本6,会报错amfe-flexible:isascalablelayoutschemepostcss-pxtorem:apostcssplug-infor将单位转换为rem.3.main.jsimportimport'amfe-flexible'4。新建项目根目录postcss.config.jsmodule.exports={plugins:{'postcss-pxtorem':{rootValue:192,//如果是双图750px,rootValue写75,如果是双图375px,写入37.5propList:['*'],}}}本地开发已测试:OK。构建测试:好的。