<script>
function adjustFontSize() {
let deviceWidth = document.documentElement.clientWidth || window.innerWidth
let rootFontSize = deviceWidth / 19.2
document.querySelector('html').style.fontSize = rootFontSize + 'px'
}
adjustFontSize()
window.addEventListner('resize', function () {
adjustFontSize()
})
</script>
网友评论