Blogger Information
Blog 24
fans 0
comment 0
visits 10903
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Emmet常用的8种语法形式 10.14
皮皮志
Original
308 people have browsed it

Emmet常用的8种语法形式

1.标签与内容

  1. <!--h3{html是结构化标签语言}-->
  2. <h3>html是结构化标签语言</h3>
  3. <!--.title{默认标签div}-->
  4. <div class="title">默认标签div</div>
  5. <!--#title{默认标签div}-->
  6. <div id="title">默认标签div</div>

2.属性和语法糖

id,class是高频,通用属性

  1. <!-- [id=app]{app} -->
  2. <div id="app">app</div>
  3. <!-- [class=title]{title} -->
  4. <div class="title">title</div>

id快捷输入是#,class是.

  1. <!-- #app{app1} -->
  2. <div id="app">app1</div>
  3. <!-- .title{title1} -->
  4. <div class="title">title1</div>

3.重复

多出现在表格,用*表示

  1. <!-- .container{box}*3 -->
  2. <div class="container">box</div>
  3. <div class="container">box</div>
  4. <div class="container">box</div>

4.父子

父子关系通常用 > 来表示

  1. <!-- ul>li{item}*3 -->
  2. <ul>
  3. <li>item</li>
  4. <li>item</li>
  5. <li>item</li>
  6. </ul>

5.兄弟

兄弟关系通常用 + 来表示

  1. <!-- h3{标题}+p{内容} -->
  2. <h3>标题</h3>
  3. <p>内容</p>

6.父级

父级关系通常用 ^ 来表示

  1. <!-- .box>span{text}^h3{小标题} -->
  2. <div class="box">
  3. <span>text</span>
  4. </div>
  5. <h3>小标题</h3>

7.分组

  1. <!-- nav>h3{导航}+ul>li*3>a{link} -->
  2. **为了写法更加规范直观,有如下写法**
  3. <!-- nav>h3{导航}+(ul>li*3>a{link}) -->
  4. <nav>
  5. <h3>导航</h3>
  6. <ul>
  7. <li><a href="">link</a></li>
  8. <li><a href="">link</a></li>
  9. <li><a href="">link</a></li>
  10. </ul>
  11. </nav>

8.序号

默认从1开始

  1. <!-- ul>li{item-$}*3 -->
  2. <ul>
  3. <li>item-1</li>
  4. <li>item-2</li>
  5. <li>item-3</li>
  6. </ul>

从自定义序号开始

  1. <!-- ul>li{item-$@3}*3 -->
  2. <ul>
  3. <li>item-3</li>
  4. <li>item-4</li>
  5. <li>item-5</li>
  6. </ul>

逆序

  1. <!-- ul>li{item-$@-1}*3-->
  2. <ul>
  3. <li>item-3</li>
  4. <li>item-2</li>
  5. <li>item-1</li>
  6. </ul>

效果展示图

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post