自定义模板:首选项 -> 用户代码片段 - >(如果没有自己创个)html.json
\t \" \n都是转义字符,而空格就是单纯的空格,输入时可以输入空格\
t 的意思是 横向跳到下一制表符位置 等于 Tab键
n 的意思是回车换行
========================================================================================================================================================
{
// Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"full sample": {
"prefix": "m", // 对应的是使用这个模板的快捷键
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-CN\">",
"\t<head>",
"\t\t<meta charset=\"UTF-8\">",
"\t\t<title>新页</title>",
"\t</head>\n",
"\t<body>\n",
"\t</body>",
"</html>"
]
}
}
========================================================================================================================================================
{
// Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"full sample": {
"prefix": "m",// 对应的是使用这个模板的快捷键
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-CN\">",
"\t<head>",
"\t\t<meta charset=\"UTF-8\">",
"\t\t<title>新页</title>",
"\t</head>\n",
"\t<body>\n",
"\t</body>",
"</html>"
]
}
}
========================================================================================================================================================
{
"full sample": {
"prefix": "mb", // 对应的是使用这个模板的快捷键
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-CN\">",
"<head>",
"\t<meta charset=\"UTF-8\">",
"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
"\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
"\t<title>moban</title>",
"</head>",
"<body>\n",
"\t<script></script>",
"</body>",
"</html>"
],
}
}
========================================================================================================================================================
{
"full sample": {
"prefix": "mb", // 对应的是使用这个模板的快捷键
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-CN\">",
"\t<head>",
"\t\t<meta charset=\"UTF-8\">",
"\t\t<title>新页</title>",
"\t</head>\n",
"\t<body>\n",
"\t</body>",
"</html>"
],
}
}
========================================================================================================================================================
{
"full sample": {
"prefix": "m",
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-CN\">\n",
"<head>",
"\t\t<meta charset=\"UTF-8\"\t/>",
"\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\t/>",
"\t\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\"\t/>",
"\t\t<title>新页</title>",
"\t\t<link rel=\"stylesheet\" href=\"./static/css/index.css\">",
"\t\t<base target=\"_blank\"\t/>",
"</head>\n",
"<body>\n",
"</body>\n",
"</html>"
],
}
}