JavaScript:动态引入 .css 文件

// 引入dialog.css
!function(){
    var link = document.createElement("link");
    link.rel = "stylesheet";
    link.type = "text/css";
    link.href = "./css/dialog.css";
    var head = document.getElementsByTagName("head")[0];
    head.appendChild(link);

}()

原文出处:https://malaoshi.top/show_1IX3o3XAQj4w.html