简体   繁体   中英

Using javascript to load css file (by using @import not by link)

I have been trying to import a css file using @import through javascript. I know there are other methods like createELement("link") through js but I need to import the css file instead of linking it, because I'm working on client site and their css is conflicting with mine. I can't set !important for all my css and thought @import css file has much higher preference than linked css file and its working.I just need to know how to import it using js.

Javascript 没有 @import 。您可以查看此链接以获取更多信息有关它的更多信息

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM