JS 中的 StyleSheets ,在chrome下无效

2025-04-04 16:20:47
推荐回答(1个)
回答1:

css文件中的样式在Chrome中是无法读取内容的。
除非你的css内容在页面上(inline内联的),下面的写法才有效
document.styleSheets[0].rules[0].style.width