When using the shift+! shortcut in VS Code to generate a basic HTML template (<!DOCTYPE html>
), the editor is throwing an “unexpected token” error, specifically pointing at the <!DOCTYPE html>
line. This seems to be a basic code snippet, and I’m unsure why it’s causing an error. Can anyone help me understand and resolve this issue?
Code Snippet:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h2>hello world</h2>
</body>
</html>
New contributor
Shivank is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.