84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
是这样的,看到网上有说可以动态定义根元素的font-size,我使用了document.documentElement.clientWidth/10来定义的,设计稿的宽度是750,按理来说在iphone6上的font-size要为75的,可是,我的却是37.5,然后就很迷茫了
走同样的路,发现不同的人生
;(function (doc, win, undefined) {
var docEl = doc.documentElement, resizeEvt = 'orientationchange' in win? 'orientationchange' : 'resize', recalc = function () { var clientWidth = docEl.clientWidth; if (clientWidth === undefined) return; docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; }; if (doc.addEventListener === undefined) return; win.addEventListener(resizeEvt, recalc, false); doc.addEventListener('DOMContentLoaded', recalc, false)
})(document, window);
iphone的devicePixelRatio的为2,所以你需要设置
;(function (doc, win, undefined) {
})(document, window);
iphone的devicePixelRatio的为2,所以你需要设置