jade注释

在jade里面注释是有多种方式的
单行注释,加两个//,跟js里面一样
//h1.title#title imoock jade study
=>
<!--h1.title#title imoock jade study-->
非缓冲注释
//- h1.title#title imoock jade study
=>
''
这种注释是不会编译到浏览器里面,html里面就没有了这行代码
块注释
//-
    p
       | 12
       strong 11
       | 34
       span 22
       | 56
       | 78
       | 90
       a(href='#') 33    
注释掉上层,就相当于注释掉里面掉多层子元素



如果是ie8这样掉浏览器注释
1、head前面加上这段
<!--[if IE 8]><html class='ie8'><![endif]-->
<!--[if IE 9]><html class='ie9'><![endif]-->
<!--[if !IE]><!--><html><!--<![endif]-->
2、最后加上</html>这个闭合标签
3、head平级标签不缩进
4、文档的编码格式也加上
eg:
doctype html
<!--[if IE 8]><html class='ie8'><![endif]-->
<!--[if IE 9]><html class='ie9'><![endif]-->
<!--[if !IE]><!--><html><!--<![endif]-->
head
    meta(charset='utf-8')
    title jade study
body
        //- h1.title#title imoock jade study
        div#id.classname
        #id.classname
       h1.title(class='title1 title2',id='title') imoock jade study
        //-
           p
               | 12
               strong 11
               | 34
               span 22
               | 56
               | 78
               | 90
               a(href='#') 33
</html>        
=>
<!DOCTYPE html><!--[if IE 8]><html class='ie8'><![endif]-->
<!--[if IE 9]><html class='ie9'><![endif]-->
<!--[if !IE]><!--><html><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>jade study</title>
</head>
<body>
<div id="id" class="classname"></div>
<div id="id" class="classname"></div>
<h1 id="title" class="title title1 title2">imoock jade study</h1>
</body></html>
.的作用还是非常大的
比如我要写样式
style.
    body{
        color:red;
    }
=>
<style>
    body{
        color:red;
    }
</style>    
比如我要写js
script.
    var i = 'jade'
=>
<script>var i = 'jade'</script>
原文地址:https://www.cnblogs.com/wzndkj/p/9256721.html