3 回答
TA贡献4条经验 获得超4个赞
html { font-size: 20px; height:100%; width:100%;}
@media only screen and (min-width: 400px) { html { font-size: 21.33333333px !important; }}
@media only screen and (min-width: 414px) { html { font-size: 22.08px !important; }}
@media only screen and (min-width: 480px) { html { font-size: 25.6px !important; }}
TA贡献8条经验 获得超1个赞
!new function(){var a=this;a.width=750,a.fontSize=100,a.widthProportion=function(){var b=(document.body&&document.body.clientWidth||document.getElementsByTagName("html")[0].offsetWidth)/a.width;return b>1?1:b},a.changePage=function(){document.getElementsByTagName("html")[0].setAttribute("style","font-size:"+a.widthProportion()*a.fontSize+"px !important")},a.changePage(),window.addEventListener("resize",function(){a.changePage()},!1)};
引入这段js,设计图的750px = 7.5rem
添加回答
举报