Blogger Information
Blog 3
fans 0
comment 0
visits 1093
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Emmet常用的8种语法形式
刘勇
Original
445 people have browsed it

Emmet常用的8种语法形式

1.标签与字符 {}

  1. <!--输入.{title}后按tab后直接显示以下内容-->
  2. <div class="">title</div>

演示

Emmet演示

2.属性和语法糖 []

  1. <!--.表示class #表示id-->
  2. <!-- 输入.[id=app]{app}后按tab后直接显示以下内容-->
  3. <div class="" id="app">app</div>
  4. <!-- 输入#[app]{app}后按tab后直接显示以下内容-->
  5. <div id="" apple="">apple</div>

演示

演示

3.重复 *

  1. <!--重复 * -->
  2. .dog{sky}*5
  3. <div class="dog">sky</div>
  4. <div class="dog">sky</div>
  5. <div class="dog">sky</div>
  6. <div class="dog">sky</div>
  7. <div class="dog">sky</div>

演示

演示

4.层级关系(父子:’>’)

  1. 层级关系
  2. <!--ul>li{toto}*3-->
  3. <ul>
  4. <li>toto</li>
  5. <li>toto</li>
  6. <li>toto</li>
  7. </ul>

演示

演示

5.兄弟关系

  1. <!--h4{标题}+p{兄弟}-->
  2. <h4>标题</h4>
  3. <p>兄弟</p>

演示

演示

6.父级

  1. <!--.box{title}>span^h2{sos}-->
  2. <div class="box">title<span></span></div>
  3. <h2>sos</h2>

演示

演示

7.分组

  1. <!--分组(...)-->
  2. <!--nav>h2{导航}+(ul>li*3>a{link})-->
  3. <nav>
  4. <h2>导航</h2>
  5. <ul>
  6. <li><a href="">link</a></li>
  7. <li><a href="">link</a></li>
  8. <li><a href="">link</a></li>
  9. </ul>
  10. </nav>

演示

演示

8.序号标识符:$,$@

<!--顺序ul>li{title-$}*5-->

  1. <ul>
  2. <li>title-1</li>
  3. <li>title-2</li>
  4. <li>title-3</li>
  5. <li>title-4</li>
  6. <li>title-5</li>
  7. </ul>
  8. <!--ul>li{title-$@9}*5-->
  9. <ul>
  10. <li>title-9</li>
  11. <li>title-10</li>
  12. <li>title-11</li>
  13. <li>title-12</li>
  14. <li>title-13</li>
  15. </ul>
  16. <!--ul>li{title-$@-}*5-->
  17. <ul>
  18. <li>title-5</li>
  19. <li>title-4</li>
  20. <li>title-3</li>
  21. <li>title-2</li>
  22. <li>title-1</li>
  23. </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