是否可以检查 CSS 检测浏览器是否支持 javascript? 或为不支持 javascript 的浏览器设置其他 CSS 媒体查询?
最佳答案
你可以不用 javascript 来做。你必须使用... HTML!
有一个标签:noscript
总结:
The HTML
<noscript>
Element defines a section of html to be inserted if a script type on the page is unsupported or if scripting is currently turned off in the browser.
示例:
<noscript>
<!-- this content will be display if no js -->
</noscript>
在你的情况下,我认为你需要这样的东西:
<noscript>
<link rel="stylesheet" type="text/css" href="css/nojs.css" />
</noscript>
如果您想了解更多信息,this topic on SO还不错。
关于html - CSS检测浏览器支持javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22248886/