Home > Development Tools > VSCode > How to preset html template in vscode

How to preset html template in vscode

王林
Release: 2019-11-09 15:20:26
Original
4945 people have browsed it

How to preset html template in vscode

1. Open: Preferences - User Code Snippet

How to preset html template in vscode

2. Select HTML or HTML5 in the pop-up window. (You can also enter a quick search in the search box)

How to preset html template in vscode

3. Delete the default comments and enter the following template (example, you can write it in the format you need )

{
	"html:5": {
		"prefix": "h",
		"body": [
			"<!DOCTYPE html>",
			"<html>",
			"<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></title>",
			"</head>",
			"<body>",
				
			"</body>",
			"</html>",
		],
		"description": "HTML5"
	}
}
Copy after login

The value of the prefix attribute, here is "h", when you enter h on the page, you will be prompted.

Pay attention to character escaping for the content on the head side.

How to preset html template in vscode

Recommended tutorial: vscode tutorial

The above is the detailed content of How to preset html template in vscode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template