Lesson 3 of 51 · Module 1, lesson 3 of 6 · 5 min
Install a code editor
Install Visual Studio Code and open your website folder in it.
What you'll learn
- What a code editor is, and why you should not use a word processor for code
- How to install Visual Studio Code on Windows or macOS
- How to open your website folder in it
Why this matters
You will spend most of your time as a web developer inside a code editor. A good editor shows each part of your code in a different colour, helps you find mistakes, and saves plain text — which is exactly what a browser needs.
What a code editor is
A code editor is a program for writing code. It looks a little like a word processor, but it is different in one important way: it saves plain text only, with no hidden formatting.
Programs such as Microsoft Word, Pages or WordPad save hidden formatting inside the file (fonts, sizes, page margins). A browser cannot read that as HTML. So never write code in them.
In this course we use Visual Studio Code, usually called VS Code. It is free, it works on Windows, macOS and Linux, and many professional developers use it every day.
Install VS Code on Windows
- Open your browser and go to code.visualstudio.com.
- Click Download for Windows.
- Open your Downloads folder and double-click the file that was downloaded. Its name starts with
VSCodeUserSetup. - Accept the agreement and click Next. The standard choices are fine.
- On the screen called Select Additional Tasks, tick the two boxes that start with Add "Open with Code" action. They let you right-click a folder and open it in VS Code.
- Click Install, then Finish. VS Code opens.
Install VS Code on macOS
- Open your browser and go to code.visualstudio.com.
- Click Download for macOS. A
.zipfile downloads. - Open your Downloads folder. If you see a
.zipfile, double-click it. You now have Visual Studio Code.app. - Drag Visual Studio Code.app into your Applications folder.
- Open Applications and double-click Visual Studio Code. macOS asks whether you are sure you want to open an app downloaded from the internet. Click Open.
If you use Linux, the same website has a download for your system.
Cannot install programs? On a work, school or library computer you may not be allowed to. You can still follow the next lessons with the Try code tab on the right edge of each lesson page: it runs HTML inside your browser. Install VS Code on your own computer when you can — real projects need real files and folders.
Open your website folder
Always open the whole folder, not a single file. VS Code then shows all the files of your website in one list.
- In VS Code, click File › Open Folder… (On macOS, File › Open… also works.)
- Go to Documents, click my-website once, then click Select Folder (on macOS: Open).
- VS Code may ask: "Do you trust the authors of the files in this folder?" It is your own folder, so click Yes, I trust the authors.
What you'll see
On the left of VS Code is the Explorer panel. It shows MY-WEBSITE in capital letters, with nothing under it yet. That is your empty folder. (VS Code shows folder names in capitals. The real name is still my-website.)
Two settings to change now
- Auto Save: click File › Auto Save so that it has a tick. VS Code now saves your work a moment after you stop typing. You can still save at any time with
Ctrl + S(Windows) orCommand + S(macOS). - Word Wrap: click View › Word Wrap. Long lines now wrap onto the next line instead of running off the right side of the window.
Try it yourself
Close VS Code completely, then open it again. It should open your my-website folder automatically. If it does not, open it again with File › Open Folder…
Common mistakes
- Opening one file instead of the folder. VS Code still works, but you cannot see your other files, and some features are missing. Fix: File › Open Folder… and choose
my-website. - Running VS Code from the Downloads folder (macOS). It may keep asking the same security question and may not update. Fix: drag it into Applications first, then open it from there.
- Writing HTML in Word, Pages or WordPad. The file contains hidden formatting and the browser cannot use it. Fix: always use VS Code.
Check yourself
- Why is Microsoft Word a poor tool for writing HTML?
- Should you open a single file or the whole folder in VS Code?
- What does Auto Save do?
Answers
- It saves hidden formatting in the file. A browser needs plain text.
- The whole folder,
my-website. - It saves your file automatically, a moment after you stop typing.
Next: your folder and your editor are ready. In the next lesson you will create your first web page and open it in a browser.

