Emmet使用
一、基本语法:
1、后代:>
简写:nav>ul>li
<nav>
<ul>
<li></li>
</ul>+
</nav>
2、兄弟: +
简写:div+div+p
<div></div>
<div></div>
<p></p>
3、上级:^
(1)单级简写: div+div>p>span+em^bq
<div></div>
<div>
<p><span></span><em></em></p>
<blockquote></blockquote>
</div>
(2)多级上级简写:div+div>p>span+em^^bq
`<div></div>
<div>
<p><span></span><em></em></p>
</div>
<blockquote></blockquote>
4、分组:()
(1)单层简写:div>(header>ul>li*2>a)+footer>p
<div>
<header>
<ul>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</header>
<footer>
<p></p>
</footer>
</div>
(2)多级简写:(div>dl>(dt+dd)*3)+footer>p
<div>
<dl>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
</dl>
</div>
<footer>
<p></p>
</footer>
5、乘法:*
简写: ul>li*5
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
6自增符号:$
(1)简写: ul>li.item$*5
<ul>
<li class="item1"></li>
<li class="item2"></li>
<li class="item3"></li>
<li class="item4"></li>
<li class="item5"></li>
</ul>
(2)简写: h$[title=item$]{Header $}*3
<h1 title="item1">Header 1</h1>
<h2 title="item2">Header 2</h2>
<h3 title="item3">Header 3</h3>
(3)简写: ul>li.item$$$$*5
<ul>
<li class="item0001"></li>
<li class="item0002"></li>
<li class="item0003"></li>
<li class="item0004"></li>
<li class="item0005"></li>
</ul>
( 4 ) 缩写:ul>[email protected]*5
<ul>
<li class="item5"></li>
<li class="item4"></li>
<li class="item3"></li>
<li class="item2"></li>
<li class="item1"></li>
</ul>
(5)缩写:ul>[email protected]*5
<ul>
<li class="item3"></li>
<li class="item4"></li>
<li class="item5"></li>
<li class="item6"></li>
<li class="item7"></li>
</ul>
7、ID和类属性
(1)简写:div#header
<div id="header"></div>
(2)简写: div.title
<div class="header"></div>
(3)简写: form#search.wide
<form action="" id="search" class="wide"></form>
(4)简写: p.class1.class2.class3
<p class="class1 class2 class3"></p>
8、自定义属性
(1)简写: h1[title="Hello World"]
<h1 title="Hello World"></h1>
(2)简写: td[rowspan=2 colspan=3 title]
<td rowspan="2" colspan="3" title=""></td>
(3)简写:[a='value1' b="value2"]
<div a="value1" b="value2"></div>
9、文本:{}
(1)简写: a{a标签}
<a href="">a标签</a>
(2)简写: p>{Click }+a{here}+{ to continue}
<p>Click <a href="">here</a> to continue</p>
10、隐式标签
(1)简写: .class
<div class></div>
(2)简写: em>.class
<em><span class></span></em>
(3)简写: ul>.class
<ul>
<li class></li>
</ul>
(4)简写: table>.row>.col
<table>
<tr class="row">
<td class="col"></td>
</tr>
</table>
二、html标签语法
1、所有未知的缩写都会转换成标签
简写: xxx
<xxx></xxx>
2、基本html标签
(1)缩写: !
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
</body>
</html>
(2)缩写:link
<link rel="stylesheet" href="">
(3)简写: style
<style></style>
(4)简写:script
<script></script>
(5)简写: script:src
<script src=""></script>
下一篇: jupyter修改默认路径