我在使用此代码的 Internet Explorer 11 中遇到“IndexSizeError”错误:
var style = document.createElement('style');
document.head.appendChild(style);
style.sheet.insertRule('td {overflow: visible}');
根据 https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/insertRule索引参数是可选的。
最佳答案
在 IE11 中,如果我添加索引参数,错误将得到修复:
var style = document.createElement('style');
document.head.appendChild(style);
style.sheet.insertRule('td {overflow: visible}', 0);
关于css - 如何在 Internet Explorer 中正确使用 CSSStyleSheet.insertRule()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58695205/