1 |
|
html初始取100是为了避免默认的16px被缩小后可能会有小数,浏览器对小数会四舍五入导致比例计算错误
1 | const computedSize = window.getComputedStyle(document.documentElement, null).getPropertyValue('font-size') |
1 | <!DOCTYPE html> |
html初始取100是为了避免默认的16px被缩小后可能会有小数,浏览器对小数会四舍五入导致比例计算错误
1 | const computedSize = window.getComputedStyle(document.documentElement, null).getPropertyValue('font-size') |
微信打赏
支付宝打赏