# 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