DevAcademy
LearnHTMLHTML Setup
BeginnerHTML

HTML Setup

Set up your development environment and create, save, and open your first HTML file in a browser.

Reading Time

10 min

Lesson

Lesson 2 of 27

What You Need

Writing HTML requires no installation, compiler, or server. You only need a text editor and a web browser — both of which you likely already have.

Creating Your First File

Create a new file named index.html. The .html extension tells your operating system and browser to treat the file as a web page.

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>My First Page</title>
  </head>
  <body>
    <h1>Hello, World!</h1>
    <p>This is my first HTML page.</p>
  </body>
</html>
Output

Opening the File

Double-click the file to open it in your default browser, or right-click it and choose "Open with" to pick a specific browser. You can also drag the file directly into an open browser window.

Use a Live Server

Install the "Live Server" extension in VS Code. It runs a local development server and automatically refreshes the browser every time you save a file — a huge time saver.

File Naming

The homepage of most websites is conventionally named index.html because web servers automatically load that file when a folder is requested.

Save With the Right Extension

Make sure your editor saves the file as .html and not .txt. Some editors add a hidden .txt extension by default — enable "show file extensions" in your operating system to verify.

Summary

All you need to start writing HTML is a text editor and a browser. Create an .html file, add some markup, and open it in your browser to see the result instantly.

Interview Questions

Quick Quiz

1. What file extension is used for HTML files?

2. Do you need to install a compiler to run HTML?

3. What is the conventional name for a website homepage file?