好简单呀,直接
function createStyleSheet() {
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
head.appendChild(style);
return style.sheet ||style.styleSheet;
}
var style = document.createElement('style');
style.innerHTML ='样式内容';
document.head.append(style);