window.onresize = setHtmlFontSize;
function setHtmlFontSize () {
const htmlWidth =
document.documentElement.clientWidth || document.body.clientWidth;
const htmlDom = document.getElementsByTagName(‘html’)[0];
htmlDom.style.fontSize = htmlWidth >= 500 ? ’50px’ : htmlWidth / 10 + ‘px’;
}
setHtmlFontSize();
(文章今日已有 1 人访问,总访问量 4 ::>_<::)