在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>

jade注释的更多相关文章

  1. Jade之注释

    注释 jade注释可以保留在编译后生成的html中,也可以不保留. jade: // 这个会保留下来 p Hello //- 这个不会保留 p World html: // 这个会保留下来 <p ...

  2. jade模板引擎学习笔记(WebsStorm9.0.3+ nodejs+express+jade)

    jade环境搭建 jade标签写法 jade注释 jade添加类名.id.属性 jade添加脚本,css jade变量 jade多行文本显示 jade流程代码:for,each,while jade流 ...

  3. jade模板引擎的基本使用

    jade和ejs很大的不同是通过缩进的方式解决嵌套和成对标签的问题,比较适合有代码洁癖的同学. jade官方有基础的语法: http://naltatis.github.io/jade-syntax- ...

  4. node之jade和ejs的使用方法 jade篇

    let express = require('express'); let consolidate = require('consolidate'); let app = express(); // ...

  5. 更改ejs模板引擎的后缀为html

    安装 EJS 在项目目录右键->Open Command Prompt Here 输入 npm install ejs 打开app.js //app.set('view engine', 'ja ...

  6. jsde与gulp使用说明

    jade是一款基于haml的html模板引擎,已改为pug 1.全局安装 npm install jade -g 新建一个jade文件夹,再建一个后缀名为.jade的文件编辑.jade文件 jade ...

  7. Jade模板引擎让你飞

    写在前面:现在jade改名成pug了 一.安装 npm install jade 二.基本使用 1.简单使用 p hello jade! 渲染后: <p>hello jade!</p ...

  8. jade模板

    jade 模板使用 npm install jade -g      安装到全局 jade index.jade         导出一个 index.html 压缩后的 jade -P index. ...

  9. jade学习01

    编写 简单例子 doctype html html head title learn jade body h1 learn jade 常用命令 编译: jade index.jade //默认编译成压 ...

随机推荐

  1. PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'exchange' in vhost '/': received 'direct

    最近在搞rabbitmq,把解决问题方法记下 问题1:PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'exchange' in ...

  2. git 版本控制中回溯到某个历史版本

    1.git log 查看之前的版本号 2. git reset --hard 版本号 3.git push -f -u origin 分支 恢复上一个版本是: git reset --hard HEA ...

  3. js复制json对象

    var newJson = JSON.parse(JSON.stringify(json对象));

  4. Appium移动自动化测试-----(六)2.AppiumDesktop录制脚本生成极简脚本

    AppiumDesktop启动页面: 启动AppiumDesktop以后点击该页面右上角的Start New Session按钮,就会启动一个新的会话窗口(如下图),在这个窗口我们需要配置一些Desi ...

  5. xsy 2018 【NOIP2013】货车运输

    [NOIP2013]货车运输 Description A 国有n座城市,编号从1到n,城市之间有m条双向道路.每一条道路对车辆都有重量限制,简称限重.现在有q辆货车在运输货物,司机们想知道每辆车在不超 ...

  6. QT加载自带字体

    #include <QCoreApplication> #include <QStringList> #include <QFontDatabase> #inclu ...

  7. c语言实现串

    串  (string)是由零个或者多个字符组成的有限序列,又称字符串 一般表示为 S=“ a1 a2 a3 a4  . . . . . an”    其中S 是串名,双引号串起来的是串值,(有些书用单 ...

  8. 二十、网卡框架分析、虚拟网卡驱动和DM9621驱动分析

    一.网络设备驱动的结构 网卡设备不同于字符设备和块设备, 网络设备并不对应于/dev目录下的文件,它存放在/sys/class/net目录下. Linux系统对网络设备驱动定义了四个层次: 1. 网络 ...

  9. 15. Scala并发编程模型Akka

    15.1 Akka介绍 1) Akka是Java虚拟机JVM平台上构建高并发.分布式和容错应用的工具包和运行时,可以理解成Akka是编写并发程序的框架 2) Akka用Scala语言写成,同时提供了S ...

  10. Shiro简介、入门案例、web容器的集成

    目的: shiro简介 Shiro入门案例 Shiro与web容器的集成 shiro简介(中文官网:https://www.w3cschool.cn/shiro/andc1if0.html) 1.什么 ...