您可以使用JavaScript的getComputedStyle
方法来获取html元素的根字体大小。以下是一个例子:
var rootFontSize = window.getComputedStyle(document.documentElement, null).getPropertyValue('font-size');
console.log(rootFontSize);
这将打印出html元素的根字体大小。
您可以使用JavaScript的getComputedStyle
方法来获取html元素的根字体大小。以下是一个例子:
var rootFontSize = window.getComputedStyle(document.documentElement, null).getPropertyValue('font-size');
console.log(rootFontSize);
这将打印出html元素的根字体大小。