Home > Web Front-end > HTML Tutorial > I have two CSS files. According to different screens, how can I use JS to control their import? _html/css_WEB-ITnose

I have two CSS files. According to different screens, how can I use JS to control their import? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:14:21
Original
1272 people have browsed it

I have two CSS files a.css and b.css

How to use JS statements to control the import into the page according to different conditions?


Reply to discussion (solution)

if(xxx){  document.write("<link href='a.css' ..... />");}else{  document.write("<link href='b.css' ..... />");}
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template