rem在移动端的应用

参考淘宝移动端页面https://h5.m.taobao.com/对rem的处理

以iphone6/7/8 (375*667)为基准设置1rem=100px;

var elem = document.getElementsByTagName('html')[0], size = document.body.clientWidth / 375 * 100;
elem.style.fontSize = size+'px';

猜你喜欢

转载自www.cnblogs.com/zml-mary/p/9035972.html