【发布时间】:2023-03-27 16:47:01
【问题描述】:
在jade 中,我想根据this method 放入一个有条件的html 标签,它放入
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->
在 html 文件的顶部。
我试过了
//[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]
//[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]
//[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]
//[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]
head
...
但是jade忽略了html标签,最后没有写</html>标签。这是无效的 html,会导致 IE 根本不显示任何内容。
有什么办法吗?
如果没有办法,我想我会只使用 javascript 解决方案。
【问题讨论】:
标签: html internet-explorer node.js pug