I've been doing a lot of searching and haven't quite found the solution to my problem.
What I'm trying to do, is have two CSS style sheets for a website. One style sheet for when javascript or jQuery is enabled, and one for when it is disabled. How would I go about doing this?
I've been doing a lot of searching and haven't quite found the solution to my problem.
What I'm trying to do, is have two CSS style sheets for a website. One style sheet for when javascript or jQuery is enabled, and one for when it is disabled. How would I go about doing this?
Share Improve this question asked Nov 19, 2010 at 0:24 JandaJanda 211 bronze badge2 Answers
Reset to default 9Use something like this:
<noscript>
<link type="text/css" href="noscript.css" rel="stylesheet" />
</noscript>
Hope this helps!
EDIT
For when JS is enabled, just create the <link>
tag using JS. (document.write(...);
)
Your second stylesheet can just override whatever is in the first. Past (after) that, just include the second inside a <noscript>
tag, like this:
<noscript>
<link rel="stylesheet" type="text/css" href="myStyles.css">
</noscript>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745356300a4624139.html
评论列表(0条)