在js中加载css

//调用
cssget()
function cssget() {
var style = (function() {
            var style = document.createElement('style');
            document.head.appendChild(style);
            return style;
        })();
        //使用
    style.sheet.insertRule('body {margin: 0px;padding:0px;}', )
}        
原文地址:https://www.cnblogs.com/520yh/p/14478504.html