# H5响应式开发
var html = document.documentElement;
var k = 375;
if (window.orientation == 90 || window.orientation == -90) {
if (html.clientHeight <= k) {
html.style.fontSize = (html.clientHeight / 750) * 100 + "px";
} else {
html.style.fontSize = (k / 750) * 100 + "px";
}
} else {
html.style.fontSize = (html.clientWidth / 750) * 100 + "px";
}
设置分界点为375px
的目的是,当设备为iphone6/7/8
时,font-size
恰好为50px