Skip to main content

Beginner-Friendly Topic

Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on.You've got this!

Lesson 10 of 10

Setting Up Your HTML Environment

Before you start writing HTML efficiently, you need the right tools. While you can technically write HTML in Notepad and open it in a browser, professional developers use code editors with powerful features like syntax highlighting, auto-completion, and live preview. In this topic, you will set up Visual Studio Code (the most popular free code editor), install essential extensions, learn time-saving shortcuts like Emmet, and understand how to preview your HTML pages with Live Server. This setup will make your coding experience 10x faster and more enjoyable.

15 minBy Priygop Editorial TeamUpdated 2026Peer Reviewed & Verified

Setting Up VS Code

Visual Studio Code (VS Code) is the most popular code editor in the world, used by over 70% of professional web developers. It is completely free, open-source, and available for Windows, macOS, and Linux.

Here is how to get started:

  1. 1Download VS Code from https://code.visualstudio.com
  2. 2Install it with default settings
  3. 3Open VS Code and create a new folder for your project (File → Open Folder)
  4. 4Create a new file called index.html (File → New File)
  5. 5Type ! (exclamation mark) and press Tab - this uses Emmet to generate a complete HTML boilerplate instantly!

Why 'index.html'? Naming your main file 'index.html' is a web convention. When a server receives a request for a directory (like example.com/about/), it automatically looks for index.html in that directory. It is the default homepage of any folder.

File naming rules:
• Use lowercase letters: about.html (not About.HTML)
• Use hyphens for spaces: contact-us.html (not contact us.html)
• Always use .html extension
• No special characters or spaces in file names

Diagram
Loading diagram…

Standard workflow for editing and live-previewing HTML projects

Essential VS Code Extensions

  • Live Server - Auto-refreshes your browser every time you save. Install it, right-click your HTML file, and select 'Open with Live Server'. This is the #1 must-have extension.
  • Emmet (Built-in) - Already included in VS Code. Type shortcuts and press Tab to generate HTML. Example: div.card>h2+p generates <div class='card'><h2></h2><p></p></div>
  • Prettier - Code Formatter - Automatically formats your code to be clean and consistent when you save. Configure: Settings → 'Format On Save' → Enable.
  • Auto Rename Tag - When you rename an opening tag, the closing tag automatically renames too. Huge time saver.
  • HTML CSS Support - Provides CSS class name autocomplete inside your HTML files.
  • HTMLHint - Detects common HTML errors and shows warnings as you type.
  • Color Highlight - Shows color previews next to color codes in your CSS (shows a colored square next to #E44D26).

Emmet Shortcuts (Built Into VS Code)

Emmet Shortcuts (Built Into VS Code)
<!-- Type these shortcuts in VS Code and press Tab: -->

<!-- ! → Full HTML5 boilerplate -->
<!-- Generates the complete structure: -->
<!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>
  
</body>
</html>

<!-- Common Emmet shortcuts: -->
<!-- h1                → <h1></h1> -->
<!-- p                 → <p></p> -->
<!-- div.card          → <div class="card"></div> -->
<!-- div#main          → <div id="main"></div> -->
<!-- div.card#featured → <div class="card" id="featured"></div> -->
<!-- ul>li*5           → <ul><li></li><li></li><li></li><li></li><li></li></ul> -->
<!-- h2+p              → <h2></h2><p></p> -->
<!-- a:link            → <a href="http://"></a> -->
<!-- img               → <img src="" alt=""> -->
<!-- input:email       → <input type="email"> -->
<!-- p{Hello World}    → <p>Hello World</p> -->
<!-- div>p*3           → <div><p></p><p></p><p></p></div> -->

Project Folder Structure

  • A typical web project folder structure looks like this:
  • my-website/ (project root folder)
  • ├── index.html (homepage - main HTML file)
  • ├── about.html (about page)
  • ├── contact.html (contact page)
  • ├── css/ (folder for all CSS files)
  • │ └── styles.css
  • ├── js/ (folder for all JavaScript files)
  • │ └── script.js
  • ├── images/ (folder for all images)
  • │ ├── logo.png
  • │ └── hero.jpg
  • └── assets/ (other files: fonts, videos, PDFs)
  • Following this structure keeps your project organized and is the industry standard that employers expect.

Quick Quiz

Key Takeaways

  • Before you start writing HTML efficiently, you need the right tools.
  • Live Server - Auto-refreshes your browser every time you save. Install it, right-click your HTML file, and select 'Open with Live Server'. This is the #1 must-have extension.
  • Emmet (Built-in) - Already included in VS Code. Type shortcuts and press Tab to generate HTML. Example: div.card>h2+p generates <div class='card'><h2></h2><p></p></div>
  • Prettier - Code Formatter - Automatically formats your code to be clean and consistent when you save. Configure: Settings → 'Format On Save' → Enable.

Hands-on Practice Tools for this Course

Test what you learn using these free in-browser developer utilities (no signup required).

All 40+ Tools

Topics in This Module

0/10 done