# Emmet
Emmet(前身为 Zen Coding)是一个前端编码工具
# 语法
# 后代: >
nav > ul > li;
1
# 兄弟: +
div+p+bq
1
# 上级: ^
div+div>p>span+em^bq
div+div>p>span+em^^bq
1
2
2
# 分组: ()
div>(header>ul>li*2>a)+footer>p
(div>dl>(dt+dd)*3)+footer>p
1
2
2
# 乘法: *
ul>li*5
1
# 自增符号: $
ul>li.item$*5
h$[title=item$]{Header $}*3
ul>li.item$$$*5
ul>li.item$@-*5
ul>li.item$@3*5
1
2
3
4
5
2
3
4
5
# ID 和类属性: #, .
#header
.title
form#search.wide
p.class1.class2.class3
1
2
3
4
2
3
4
# 自定义属性: []
p[title="Hello world"]
td[rowspan=2 colspan=3 title]
[a='value1' b="value2"]
1
2
3
2
3
# 文本: {}
a{Click me}
p>{Click }+a{here}+{ to continue}
1
2
2
# 隐式标签
.className
em>.className
ul>.className
table>.row>.col
1
2
3
4
2
3
4
# HTML
!
a
a:link
a:mail
abbr
acronym
base
basefont
br
frame
hr
bdo
bod:r
bdo:l
col
link
link:css
link:print
link:favicon
link:touch
link:rss
link:atom
meta
meta:utf
meta:win
meta:vp
meta:compat
style
script
script:src
img
iframe
embed
object
param
map
area
area:d
area:c
area:r
area:p
form
form:get
form:pose
label
input
inp
input:hidden
input[type=hidden name]
input:h
input[type:hidden]
input:text, input:t
inp
input:search
input[type=search]
input:emial
inp[type=email]
input:url
inp[type=url]
input:password
inp[type=password]
input:datetime
inp[type=datetime]
input:date
inp[type=date]
input:datetime-local
inp[type=datetime-local]
input:month
inp[type=month]
input:week
inp[type=week]
input:time
inp[type=time]
input:number
inp[type=number]
input:color
inp[type=color]
input:checkbox
input:c
input:radio
input:r
input:range
input:file
input:f
input:submit
input:s
input:image
input:i
input:button
input:b
isindex
input:reset
select
option
textarea
menu:context
menu:c
menu:t
video
audio
html:xml
keygen
command
bq
acr
fig
figc
ifr
emb
obj
src
cap
colg
fst, fset
btn
btn:b
btn:r
btn:s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118