hello-world
We're sorry but hello-world doesn't work properly without JavaScript enabled. Please enable it to
continue.
function resize() {
var docEl = document.documentElement;
var html = document.querySelector('html');
var clientWidth = docEl.clientWidth;
var fontsize = 100;
if (clientWidth >= 640) {
fontsize = 100;
} else {
fontsize = clientWidth / 640 * 100;
}
html.style.fontSize = fontsize + 'px';
document.querySelector('body').style.fontSize = fontsize + 'px';
}
resize();
window.addEventListener('resize', resize);
一键复制
编辑
Web IDE
原始数据
按行查看
历史