VScode-HTML

Visual Studio Code关于写html的快捷键

这几天写html,找别人学了一些有趣的快捷键,作用不一定很大,但还是记录一下。

1多个平级标签
输入 div*5 会有提示,按回车,出现下面的代码
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>

2多个平级排序标签
输入 div{$}*4 出现提示后,按回车,出现下面的代码
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>

3给标签加id和class
输入 div#tagId 提示,回车
<div id="tagId"></div>

输入 div.tagClass 提示,回车
<div class="tagClass"></div>

4多层嵌套标签
多层嵌套标签用>右尖括号,还可以任意组合。

span>div>section
<span>
<div>
<section></section>
</div>
</span>

span>div*3>section
<span>
<div>
<section></section>
</div>
<div>
<section></section>
</div>
<div>
<section></section>
</div>
</span>

span>div{$}*3>section
<span>
<div>
1
<section></section>
</div>
<div>
2
<section></section>
</div>
<div>
3
<section></section>
</div>
</span>

span>div*3>section{$}*3
<span>
<div>
<section>1</section>
<section>2</section>
<section>3</section>
</div>
<div>
<section>1</section>
<section>2</section>
<section>3</section>
</div>
<div>
<section>1</section>
<section>2</section>
<section>3</section>
</div>
</span>

5 ! + 回车

<!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>

6 Ctrl+/ (注释)

<!-- -->
7 快速多次复制同一行代码
crtl +c --->ctrl+v

VScode-HTML

上一篇:围绕Kubernetes的技术-架构-运维思考


下一篇:js 获取本月月初和月末时间操作