Codectionary / Developer documentation / HTML

Open a project folder, save HTML files and use VS Code’s built-in HTML editing features without adding a compiler or required extension.

Install an editor, not HTML

Visual Studio Code is an optional code editor. Download it from the official VS Code site for your operating system and follow its installer. HTML itself does not need installation. If you prefer another plain-text editor, the first-page steps work there too.

VS Code already includes HTML syntax highlighting, suggestions and formatting support. You do not need an extension to create a basic HTML page, and an extension does not replace a browser.

Work in a project folder

Create a folder such as my-first-page, then use File → Open Folder in VS Code. In the Explorer panel, create index.html inside that folder. Paste the example below and save. Working in a folder makes it easier to see whether styles.css, script.js and image paths are next to the page when you add them later.

VS Code should recognise the .html extension and offer HTML suggestions as you type. If it says Plain Text in the language selector, confirm the actual filename ends in .html. Formatting can improve indentation, but inspect the result: a formatter does not prove that your structure or content is correct.

View and update the page

Use your file manager to open the saved index.html in a modern browser, or drag the file into a browser tab. VS Code edits the source; the browser renders it. For a normal local file, save in VS Code and refresh the browser after each change. Compare the tab title with the visible h1 to see the different roles of head and body.

A basic page opened with a file: URL needs no server. Some later web features, such as requests for local resources or JavaScript modules, can be restricted for local files; use a local development server when the project requires one. Do not assume an editor preview and a browser have identical behaviour.

Syntax

my-first-page/
  index.html

Examples

A file to try in VS Code

Save as index.html, open in your browser, then change the heading.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My first webpage</title>
</head>
<body>
  <main>
    <h1>Welcome to my webpage</h1>
    <p>I'm learning how to give a page structure with HTML.</p>
    <p>Visit <a href="https://example.com/">Example Domain</a>.</p>
  </main>
</body>
</html>
  1. The .html extension enables the editor’s built-in HTML features and lets the browser treat the file as a webpage.
  2. The head supplies tab title and metadata; the body supplies visible content.
  3. Saving and refreshing is the simplest way to confirm that an edit has reached the browser.

Best practices

  • Download VS Code from its official site.
  • Open the folder rather than scattering related files.
  • Test the saved page in a browser.

Browser compatibility

Support applies to the named feature, not every attribute or behaviour in this article. Versions refer to browsers, not operating systems.

Editor setup and file-opening steps are workflows, not a single browser compatibility feature.

VS Code editing and local-file workflow

Desktop

Chrome
Unknown
Firefox
Unknown
Safari
Unknown
Edge
Unknown
Opera
Unknown

Mobile

Safari on iOS
Unknown
Chrome for Android
Unknown
Firefox for Android
Unknown
Samsung Internet
Unknown

No single verified compatibility record for this topic. Use the feature-specific articles; no browser support is inferred.

MDN BCD 8.1.5 · Dataset built 2026-10-08 · Mapping reviewed 2026-10-21. These dates are not individual browser-test or claim-verification dates. Unknown means the data does not establish support.

HTML Living Standard

Specifications & further reading