應該沒問題喔,可參考 ppk 整理的這份 W3C CSS 相容性的比較表:
http://www.quirksmode.org/dom/w3c_css.html
新增的話,IE 應該是用 addRule(),Firefox 或其他瀏覽器都支援 insertRule()
//IE
document.styleSheets[1].addRule('pre', 'font: 14px verdana');
//Firefox
var x = document.styleSheets[1];
x.insertRule('pre {font: 14px verdana}', x.cssRules.length);
|