Logo OnlineCBT
HTML Tutorial
HTML · LESSON 3

Installing VS Code and Browser Tools

Set up the modern development environment with VS Code, Live Server, and Chrome Developer Tools.

Level: Beginner to Advanced
Duration: ~60 Mins Deep-Dive
Updated: 30 Jul 2026

Installing VS Code and Browser Tools

1. Why Code Editors Matter in Modern Development

In the early days of web development, plain text editors like Windows Notepad or macOS TextEdit were used to construct simple HTML pages. However, as web applications evolved to require complex folder structures, automated linting, syntax highlighting, and live reloads, dedicated Integrated Development Environments (IDEs) and code editors became indispensable.

A professional code editor enhances developer velocity by catching syntax errors before code reaches the browser, automating repetitive typing using snippets, and providing direct integration with version control systems like Git.

Key Features of Modern Code Editors:
  • Syntax Highlighting: Color-codes tags, attributes, strings, and comments for quick visual parsing.
  • Auto-Completion (IntelliSense): Predicts element names and attribute options as you type.
  • Emmet Abbreviations: Converts short keystrokes into complete HTML tree structures instantly.
  • Real-time Linting: Highlights invalid HTML syntax or unclosed tags prior to browser execution.


2. Installing Visual Studio Code (VS Code)

Developed by Microsoft, Visual Studio Code (VS Code) is currently the industry-standard code editor used by over 70% of professional web developers globally. It is free, open-source, lightweight, and cross-platform.

Installation Process across Operating Systems

  1. Windows Installation:

    Download the official VSCodeUserSetup.exe installer from code.visualstudio.com. Run the executable and ensure you check the boxes for "Add 'Open with Code' action to Windows Explorer context menu" and "Add to PATH" during setup.

  2. macOS Installation:

    Download the .zip archive file. Extract it and drag the Visual Studio Code.app binary directly into your system's /Applications directory. Open VS Code, launch the Command Palette (Cmd + Shift + P), and type Shell Command: Install 'code' command in PATH to enable terminal activation.

  3. Linux Installation (Debian/Ubuntu):

    Download the official .deb package or install via snap in your terminal:

    sudo snap install --classic code

3. Essential Extensions for Front-End Engineering

Out of the box, VS Code provides built-in support for basic HTML markup. However, its true power lies in its extensive marketplace extension ecosystem. Installing the following four extensions transforms VS Code into a front-end engine:

  • 1. Live Server (by Ritwick Dey):

    Spins up a lightweight local development server with Live Reload capability. Whenever you save an HTML or CSS file (Ctrl + S / Cmd + S), Live Server automatically updates your open browser window without manual refreshes.

  • 2. Prettier - Code Formatter:

    An opinionated code formatter that enforces consistent indentation, spacing, and attribute alignment across HTML, CSS, and JavaScript files.

  • 3. Auto Rename Tag (by Jun Han):

    Automatically renames the paired closing HTML tag whenever you modify its corresponding opening tag, preventing mismatched element errors.

  • 4. Code Spell Checker:

    Detects spelling mistakes inside text content, classes, IDs, and attributes, helping avoid broken paths or CSS selector bugs.

4. Speeding Up Workflow with Emmet & Keyboard Shortcuts

Emmet is a built-in tool in VS Code that allows developers to write high-speed HTML markup using CSS-like selector shorthand expressions.

Emmet Expansion Examples

Typing an exclamation mark (!) and pressing Tab generates a full, valid HTML5 boilerplate structure in under one second:

<!-- Emmet Input: ! followed by Tab key -->
<!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>
Hardcoded Output Result (Generated Markup)

Complete HTML5 boilerplate instantly generated inside the editor tab.

Essential Productivity Shortcuts

Shortcut (Win/Linux) Shortcut (macOS) Action Description
Ctrl + S Cmd + S Save active file (Triggers Live Server update).
Alt + Up / Down Option + Up / Down Move selected line or block up/down.
Shift + Alt + Down Shift + Option + Down Duplicate line or block downwards.
Ctrl + / Cmd + / Toggle HTML single/multi-line comment.
Ctrl + ` Cmd + ` Toggle integrated system terminal.

5. Mastering Browser Developer Tools (DevTools)

Every modern web browser includes built-in Developer Tools (DevTools) that allow engineers to inspect the Document Object Model (DOM), debug CSS rules live, trace network payloads, and analyze console errors.

Accessing DevTools

Press F12 or right-click any element on a webpage and select Inspect (or press Ctrl + Shift + I / Cmd + Option + I).

Core DevTools Panels Explained

  • Elements Panel: Displays the live DOM tree as interpreted by the browser. You can double-click tags or text nodes to edit them temporarily in real-time.
  • Console Panel: Logs system warnings, JavaScript outputs, and HTML loading errors (e.g., 404 Not Found for missing image paths).
  • Device Mode (Responsive View): Simulates mobile viewports (iPhone, Pixel, iPad) to verify how HTML elements adjust across screen sizes.
  • Network Panel: Tracks all HTTP requests made by the client to download HTML files, images, scripts, and CSS files.
<!-- Example of Inspecting Live DOM Nodes -->
<div class="card" style="background-color: #eff6ff;">
    <h3>Inspecting via DevTools</h3>
    <p>Changes made in DevTools are temporary and assist debugging!</p>
</div>
Hardcoded Output Result (Browser Inspection View)

Inspecting via DevTools

Changes made in DevTools are temporary and assist debugging!

6. Homework Assignments & Practical Exercises

Task 1: VS Code & Extension Setup (Current Lesson)

Download and install Visual Studio Code on your machine. Open the Extensions tab (Ctrl + Shift + X) and install Live Server and Prettier. Configure VS Code settings to enable Format On Save.

Task 2: Live Server & Emmet Execution (Current Lesson)

Create a project folder named web-practice. Open it in VS Code, create a file named index.html, and use the Emmet shorthand ! + Tab to construct a boilerplate. Launch Live Server, modify the main heading, save the file, and observe the automatic live refresh behavior.

Task 3: Comprehensive Tooling & Inspector Revision (All-Inclusive Task)

Open any major public website (e.g., wikipedia.org), launch Browser DevTools, locate the main title tag inside the Elements Panel, edit its inner text live to display your name, and take a screenshot. Write down why DevTools edits do not permanently alter server files (refer back to Lesson 01 request-response concepts).

7. Frequently Asked Interview Questions

Q1: What is the main difference between a Code Editor (like VS Code) and a full IDE (like Visual Studio or Eclipse)?

Answer: A code editor is a lightweight text editor optimized for editing source code with fast startup times and extensible plugins. An IDE is a heavy, integrated software suite containing built-in compilers, complex build automation pipelines, and deep database administration tools tailored for enterprise software development.

Q2: How does Live Server improve developer productivity compared to standard local file opening?

Answer: Opening an HTML file directly via local file path (file:///C:/index.html) requires manual browser reloads after every save and restricts certain security features (like CORS and Web Workers). Live Server creates a local HTTP server (http://127.0.0.1:5500) and uses WebSockets to inject live changes automatically without reloading the browser manually.

Q3: Are edits made inside the Browser DevTools Elements Panel permanent? Explain why.

Answer: No, edits made inside DevTools are strictly temporary modifications to the in-memory Document Object Model (DOM) rendered in the local browser RAM. They do not write back to the original source .html files stored on the local disk or remote web server. Refreshing the browser re-fetches the original source files.

Q4: What is Emmet, and how does it assist front-end development?

Answer: Emmet is a built-in editor tool that converts CSS-like abbreviation expressions into complete HTML code blocks. For example, typing ul>li*3 expands into an un-ordered list containing three child list items, drastically reducing typing time and manual tag pairing errors.

Lesson 04 Preview: Creating Your First HTML Page

Now that your local workspace is configured with VS Code, Live Server, and browser developer tools, our next lesson takes you into hands-on code authoring:

  • Constructing a Clean Page Structure: Writing valid HTML5 document structures from scratch without copy-pasting.
  • Working with Headings and Paragraphs: Understanding semantic heading hierarchy (<h1> to <h6>) and block text elements.
  • Document Metadata & Titles: Setting meaningful tab titles and meta descriptions for search engine indexers.
  • Validating HTML Source Code: Running your files through the official W3C Markup Validation Service to identify and fix compliance errors.

📝 Live Lesson Practice

HTML/CSS JavaScript Python C++ C PHP
⌨️ Practice Inputs (लाइव इनपुट भरें) (खाली होने पर RED, भरने पर GREEN underline)
💻 Code Editor (Monaco VS Code Engine)
👀 Live Preview
Address Contact

+91 7877547686

E-mail

onlinecbtportal@gmail.com

Helpline Number

+91 7877547686


Click To Download
Get it on Google Play

ऐप डाउनलोड करने
के लिए Google Play पर
उपलब्ध है

WhatsApp Chat