How to improve the efficiency of writing front-end? Dry goods, fast forward!

When we are writing the front-end, when faced with repeated code, we often copy and paste. In fact, we can improve the efficiency of writing the front-end through techniques. Next, we will introduce several commonly used techniques to improve efficiency

Comment

Enter the following code

Ctrl+/

Also, uncomment is alsoCtrl+/

multiplication

*
Enter the following code

(div>ul>li)*5

Insert picture description here

Offspring

>
Enter the following code

nav>ul>li

Insert picture description here

brothers

+
Enter the following code

div+p+bq

Insert picture description here

Superior

^
Enter the following code

div+div>p>span+em^bq

Insert picture description here
Enter the following code

div+div>p>span+em^^bq

Insert picture description here

Grouping

()
Enter the following code

(div>dl>(dt+dd)*3)+footer>p

Insert picture description here

Self-increasing

$
Enter the following code

ul>li.item$*5

Insert picture description here
Reversed

 ul>li.item$@-*5

Insert picture description here
Number is 3 digits

ul>li.item$$$*10

Insert picture description here
Starting from 5, output 10

ul>li.item$@5*10

Insert picture description here

ID and class

#和.

#header

Insert picture description here

.title

Insert picture description here

form#search.wide

Insert picture description here

Custom attributes

[]

p[title="Hello world"]

Insert picture description here
Multiple attributes

 td[rowspan=2 colspan=3 title]

Insert picture description here

text

{}

a{Hello world}

Insert picture description here

p{段落内容}

Press Tab again (the same below)
For example:
Insert picture description here

Implicit label

.class

Insert picture description here

em>.class

Insert picture description here

ul>.class

Insert picture description here

table>.row>.col

Insert picture description here
There are many more, all unknown abbreviations will be converted into labels————"Poke in detail https://docs.emmet.io/cheat-sheet/

Guess you like

Origin blog.csdn.net/hanhanwanghaha/article/details/108875205