If you are using VS code then you can use this command shift + 1 and enter to auto-populate HTML Doctype in HTML or PHP.

When you will press enter it will add the following code:


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>

Answer from Abdullah Khan on Stack Overflow
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Live Preview - Visual Studio Marketplace
Extension for Visual Studio Code - Hosts a local server in your workspace for you to preview your webpages on.
🌐
DEV Community
dev.to › hannahgooding › vs-code-shortcuts-and-tricks-that-i-wish-i-knew-sooner-3mcj
VS Code shortcuts and tricks that I wish I knew sooner - DEV Community
August 21, 2020 - I personally don't find Emmet abbreviations a time saver for writing CSS, but some of the HTML abbreviations I find useful include: ... A full list of shortcuts for can be found on the Emmet Docs Cheat Sheet. Using VS Code's built in Source Control feature, you can stage your files and write commit messages with the VS Code UI, rather than using the terminal.
Discussions

visual studio code - How to automatically write html structure - Stack Overflow
I am using visual studio code .I have the php extension installed already . But it is very repetitive to create each php file with the base structure like this one . Since it does'nt automatically ... More on stackoverflow.com
🌐 stackoverflow.com
Html basic structure shortcut doesn't work
I just started experiencing this today as well. I've not found a solution other than what you've listed. It worked just fine for me yesterday More on reddit.com
🌐 r/vscode
6
3
July 10, 2022
HTML/CSS autocompletion for django-templates?
Considering Django is a templating language vscode is recognizing it as such. Django implements as a language grammar but a not language server. In order for Django to support such features the extension would require a language server that connects to the HTML Language Service, from here the server would need to provide completion capabilities in order for this to work. The extension author could also leverage Grammar injections and simply inject Django syntax into HTML but this would render Django apart of HTML which while written in combination with HTML is not HTML and would start to wreak havoc with other extensions that might be doing the same thing. The other option (for the author) would be launch the HTML Language Features client programmatically by referencing the modules path from within vscode. Basically, you’re shit out of luck. More on reddit.com
🌐 r/vscode
8
2
September 29, 2019
Edit Emmet html snippet
Did you have any luck with this? I am trying to do the same thing for the most part so that common CSS files are populated along with Bootstrap & jQuery. Instead of editing the existing code, I am trying to create a new emmet shortcut but it keeps breaking because of opening/closing tags not playing nice with JSON or quotations. More on reddit.com
🌐 r/vscode
3
4
May 3, 2018
🌐
Codecademy
codecademy.com › article › visual-studio-code
Visual Studio Code: How to Use | Codecademy
In Visual Studio Code’s Explorer pane, click on your development folder’s name. You’ll see four icons appear to the right of the folder name. Click the ’New File’ icon. Type the new file’s name with its appropriate file extension ( for example, .html, .css, .csv).
🌐
CSS-Tricks
css-tricks.com › vs-code-extensions-for-html
VS Code Extensions for HTML | CSS-Tricks
June 7, 2021 - I’d start with Emmet here, even thought it’s not technically an extension1 for VS Code. It’s built right in. You should know about it though because it’s very useful. It does “HTML Expansions” like this, which I use pretty much every day of my life:
🌐
Visual Studio Code
code.visualstudio.com › docs › languages › html
HTML in Visual Studio Code
November 3, 2021 - To improve the formatting of your HTML source code, you can use the Format Document command ⇧⌥F (Windows Shift+Alt+F, Linux Ctrl+Shift+I) to format the entire file or Format Selection ⌘K ⌘F (Windows, Linux Ctrl+K Ctrl+F) to just format ...
Find elsewhere
🌐
Wikihow
wikihow.com › computers and electronics › internet › website and blog creation › markup languages › html › 4 ways to run a html file in visual studio code - wikihow
4 Ways to Run a HTML File in Visual Studio Code - wikiHow
August 21, 2025 - Begin typing your HTML code. [4] X Research source · To open an existing file, click File in the menu bar at the top. Then click Open File. Navigate to the HTML file you want to open and click it to select it. Then click Open. ... Save the file as an HTML file. When you are ready to run an HTML file in Visual Studio Code, you'll first need to save the file as an HTML file.[5] X Research source Once you save your HTML file, you can run it in any browser of your choice.
🌐
Visual Studio Code
code.visualstudio.com › docs › configure › keybindings
Keyboard shortcuts for Visual Studio Code
November 3, 2021 - Here you will find the complete list of keyboard shortcuts for Visual Studio Code and how to change them.
🌐
Visual Studio Code
code.visualstudio.com › docs › languages › emmet
Emmet in Visual Studio Code
November 3, 2021 - Support for Emmet snippets and expansion is built right into Visual Studio Code, no extension required. Emmet 2.0 has support for the majority of the Emmet Actions including expanding Emmet abbreviations and snippets. Emmet abbreviation and snippet expansions are enabled by default in html, haml, pug, slim, jsx, xml, xsl, css, scss, sass, less and stylus files, as well as any language that inherits from any of the above like handlebars and php.
🌐
Quora
quora.com › How-do-I-make-Visual-Studio-Code-generate-auto-complete-HTML-code
How to make Visual Studio Code generate auto complete HTML code - Quora
Answer (1 of 3): Greetings, As you have noticed each new document generated in Visual Studio code starts with Untitled-1. In order to recognize the language you are working with you will need to save the document as the extension of the language you are working in for the autocomplete to functi...
🌐
James' Coffee Blog
jamesg.blog › 2023 › 04 › 08 › vs-code-html-boilerplate
TIL: Create HTML boilerplate code in Visual Studio Code | James' Coffee Blog
April 8, 2023 - In the first line of a HTML file open in Visual Studio Code, add the text below, then press enter: ... To populate only the <!DOCTYPE html> text, you can use !!!. After further research, this is an Emmet abbreviation, a shortcut in the Emmet syntax to expand concise text into full code in a web application.
🌐
The Odin Project
theodinproject.com › lessons › foundations-html-boilerplate
HTML Boilerplate | The Odin Project
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>My First Webpage</title> </head> <body> <h1>Hello World!</h1> </body> </html> Now, if you refresh the page in the browser, you should see the changes take effect, and the heading “Hello World!” will be displayed. VSCode has a built-in shortcut you can use for generating all the boilerplate in one go.
🌐
Emmet
docs.emmet.io › cheat-sheet
Cheat Sheet
Emmet Documentation · Back to main website · More developer tools: · Emmet LiveStyle · Real-time bi-directional edit tool for CSS, LESS and SCSS · Emmet Re:view · Fast and easy way to test responsive design side-by-side · Download cheat sheet as printable PDF A5 · Support: info@emmet.io ...
🌐
Medium
medium.com › javarevisited › must-know-vs-code-shortcuts-50371a8b94b6
Must Know VS Code Shortcuts. ✨Visual Studio Code Shortcuts For… | by Ishrat | Javarevisited | Medium
December 11, 2022 - Visual Studio Code Shortcuts · These VS Code shortcuts come in handy when writing hundreds and hundreds of lines of code. These help you code faster and improve your productivity 10 times. Also, you don’t require any extensions to use these shortcuts. Let’s learn some magic 🧨 · Open your VS Code editor, create a file, type, !and press Enter to get the HTML boilerplate.
🌐
Quora
quora.com › How-do-I-write-HTML-code-in-VS-Code
How to write HTML code in VS Code - Quora
Visual Studio Code comes with Emmet built-in. (Emmet - the essential toolkit for web-developers) Emmet helps you write HTML (and also CSS) with shortcuts.
🌐
CodeWithFaraz
codewithfaraz.com › home › blogs › comment shortcut keys in visual studio code: boosting your coding efficiency
Comment Shortcut Keys in Visual Studio Code: Boosting Your Coding Efficiency
January 10, 2026 - Imagine effortlessly adding comments, toggling them on and off, or commenting out entire code blocks—all with a simple key combination. Revolutionize your code commenting with a single keystroke. Highlight a line, press Ctrl + /, and watch ...
🌐
Visual Studio Code
code.visualstudio.com › docs › editing › userdefinedsnippets
Snippets in Visual Studio Code
November 3, 2021 - Code snippets are templates that make it easier to enter repeating code patterns, such as loops or conditional-statements. In Visual Studio Code, snippets appear in IntelliSense (⌃Space (Windows, Linux Ctrl+Space)) mixed with other suggestions, as well as in a dedicated snippet picker (Insert Snippet in the Command Palette).
🌐
Visual Studio Code
code.visualstudio.com › docs › getstarted › personalize-vscode
Personalize VS Code
November 3, 2021 - Learn how to personalize VS Code to your likings with themes, icons, keyboard shortcuts, display language, and settings.