您的位置: 首页 > IT文章 > 动态插入css 动态插入css 分类: IT文章 • 2022-03-24 15:13:17 function loadStyle(url) { const link = document.createElement('link'); link.type = 'text/css'; link.rel = 'stylesheet'; link.href = url; const head = document.getElementsByTagName('head')[0]; head.appendChild(link); };