Free preview
Set up your free tools
Practical task · 15 min
You only need two free tools for this course: a web browser and a code editor. In this lesson you will install the editor, create a project folder and open your first file in the browser.
Why a code editor?
You could write HTML in Notepad, but a code editor makes life much easier. It colours your code so mistakes stand out, suggests tags as you type, closes brackets for you and keeps your whole project in one window. We use Visual Studio Code (VS Code) because it is free, runs on Windows, macOS and Linux, and is the most widely used editor among web developers.
- 1
Install VS Code
Go to
code.visualstudio.com, download the version for your computer and install it with the default options. On Windows, tick "Add to PATH" if you are asked. - 2
Create a project folder
Somewhere easy to find, such as Documents, create a folder called
my-first-site. Keep every file for this course inside folders like this one. Use lowercase letters and hyphens, never spaces, in file and folder names:about-me.html, notAbout Me.html. - 3
Open the folder in VS Code
In VS Code choose File → Open Folder… and pick
my-first-site. If VS Code asks whether you trust the authors of the files, choose yes, because you are the author. - 4
Create index.html
Click the "New File" icon next to the folder name in the Explorer panel and name it
index.html. The nameindex.htmlmatters: web servers send this file automatically when someone visits a folder. - 5
Install Live Server (optional but recommended)
Open the Extensions panel (the four squares icon), search for Live Server by Ritwick Dey and install it. Now you can right-click an HTML file and choose , and the browser will refresh by itself every time you save.
Opening your page without Live Server
If you prefer not to install extensions, open your folder in your computer's file manager and double-click index.html. It opens in your default browser. After each change, save the file in VS Code (Ctrl+S or Cmd+S) and refresh the browser (F5 or Cmd+R).
Useful settings
- Turn on Auto Save (File → Auto Save) so you never wonder whether you saved.
- Turn on Word Wrap (View → Word Wrap) so long lines do not disappear off the screen.
- Learn the shortcut for the Command Palette: Ctrl+Shift+P (Cmd+Shift+P on a Mac). Almost every VS Code feature can be found there.
The browser's developer tools
Every modern browser has built-in developer tools. Right-click anything on a page and choose Inspect. A panel opens showing the HTML of that element and every CSS rule applied to it. You can even change styles there and see the result live (the changes disappear when you refresh). You will use this constantly to understand why something looks the way it does.
Try it
Check your setup
Create index.html in your project folder, type the word Hello into it, save, and open it in the browser. Then right-click the word and choose Inspect.
Show a hint
If you see the file's code instead of the word, you probably opened it in VS Code's preview rather than a browser. Open it from the file manager or with Live Server.
Show a worked answer
The browser shows "Hello". In the developer tools you will see that the browser has quietly wrapped it in <html>, <head> and <body> tags, which is exactly what the next lesson is about.
Like this lesson?
HTML & CSS Fundamentals has 21 lessons with exercises, quizzes and a final project.