HTML chapters

Chapter 2 of 17

Setting up HTML

Try this in our HTML Compiler →

Tools you need

To write and run HTML you need three things: a place to write code (any text editor such as VS Code works), a way to run the code (an interpreter or compiler for HTML), and a terminal where you can type commands. Most modern editors bundle a terminal so you only need to install one program.

Your first file

Create a file named hello.html and paste in the snippet below. Save the file, then run it from your terminal. If you see the words "Hello, World!" printed back, your installation is correct and you are ready to learn the rest of the language.

<!DOCTYPE html>
<html lang="en">
  <head><meta charset="UTF-8"><title>Hello</title></head>
  <body>
    <h1>Hello, World!</h1>
  </body>
</html>

Common installation issues

If the command is not recognised, the language is not on your system PATH. Reinstall and tick "add to PATH" if the option is offered. On a school or work machine where you cannot install software, use any online playground — the code in this course runs unchanged in a browser-based editor.

Try it yourself

HTML Compiler
CSS (optional)
Output
Code runs in a sandboxed preview inside your browser — your code is saved locally for next time.