Blogger Information
Blog 3
fans 0
comment 0
visits 1378
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
emmet 八种常见的语法格式
纵横网络
Original
539 people have browsed it

emmet 八种常见的语法格式

!+tag:快速生成html5页面源码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. </body>
  11. </html>

1.标签与内容:’{txet}’

  1. .title{内容} 输出
  2. <div class="title">内容</div>

2.属性和语法糖 ‘[attr]’

  1. [id=title]{title} 输出
  2. <div id="title">title</div>
  3. [class=title]{title} 输出
  4. <div class="title">title</div>
  5. id的语法糖 '#' class的语法糖 '.'
  6. #title{title} 输出
  7. <div id="title">title</div>
  8. .title{title} 输出
  9. <div class="title">title</div>

3.重复 ‘*’

  1. .content{文本}*3 输出
  2. <div class="content">文本</div>
  3. <div class="content">文本</div>
  4. <div class="content">文本</div>

4.父子 ‘>’

  1. div>ul>li{文本}*3 输出
  2. <div>
  3. <ul>
  4. <li>文本</li>
  5. <li>文本</li>
  6. <li>文本</li>
  7. </ul>
  8. </div>

5.兄弟关系 ‘+’

  1. h2{biaoti}+p{wenben} 输出
  2. <h2>biaoti</h2>
  3. <p>wenben</p>

6.父级 ‘^’

  1. .title>p{text}^h2{text2} 输出
  2. <div class="title">
  3. <p>text</p>
  4. </div>
  5. <h2>text2</h2>

7.分组 ‘()’

  1. nav>h3{title}+(ul>li{title2}*3) 输出
  2. <nav>
  3. <h3>title</h3>
  4. <ul>
  5. <li>title2</li>
  6. <li>title2</li>
  7. <li>title2</li>
  8. </nav>

8.序号 ‘$’ ‘$@’

  1. ul>li{item-$}*3 输出
  2. <ul>
  3. <li>item-1</li>
  4. <li>item-2</li>
  5. <li>item-3</li>
  6. </ul>
  7. ul>li{item-$@3}*3 输出
  8. <ul>
  9. <li>item-3</li>
  10. <li>item-4</li>
  11. <li>item-5</li>
  12. </ul>
  13. 倒序: ul>li{item-$@-3}*3 输出
  14. <ul>
  15. <li>item-5</li>
  16. <li>item-4</li>
  17. <li>item-3</li>
  18. </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