Skip to content

Beginner · How the web works · topic 3 of 64 · 20 min

Your toolkit: editor, browser and folders

Explanation

To build websites you need only free tools: a code editor such as VS Code, a modern browser, and a tidy project folder. Good file names and folders save you from many small bugs later.

What you need

  • A code editor: Visual Studio Code (VS Code) is free and works on Windows, Mac and Linux.
  • A modern browser: Chrome, Edge or Firefox, all with built-in developer tools.
  • A folder for each project, with clear file names.

A code editor is a program for writing code. It is like a notepad, but it colours your code, completes words for you and points out mistakes.

Think of it like this: Think of a tailor. The editor is the sewing machine, the browser is the mirror where you check the fit, and the project folder is the cupboard where every piece of cloth has its own shelf.

A tidy project folder

output
my-site/
  index.html      the home page (servers open this first)
  about.html
  css/
    styles.css
  js/
    app.js
  images/
    logo.png
A simple, common folder layout
  • Name the home page index.html: web servers open it by default.
  • Use lowercase names with hyphens, not spaces: contact-us.html, not Contact Us.html.
  • Keep CSS, JavaScript and images in their own folders.
Careful: Many servers are case-sensitive: Logo.png and logo.png are different files there, even if your Windows laptop treats them as the same. Lowercase names avoid this bug.

Useful VS Code features

  • Emmet: type ! and press Tab in an empty .html file to get a full page skeleton.
  • Format Document (Shift+Alt+F on Windows) tidies your indentation.
  • Extensions: a live preview extension reloads the page every time you save.
  • The integrated terminal (Ctrl+`) lets you run commands without leaving the editor.

Opening your page

Double-clicking index.html opens it in the browser with a file:// address. That is fine for plain HTML and CSS. Some JavaScript features (such as fetch and modules) need a small local server, which a live preview extension or "npx serve" gives you; we meet these later.

javascript
function extension(fileName) {
  return fileName.split('.').pop().toLowerCase();
}
console.log(extension('index.html')); // 'html'
console.log(extension('Logo.PNG'));   // 'png'
Getting the file type from a file name
Tip: On a phone, you can still practise: free online editors such as CodePen or the runner on this site work in the mobile browser.

Watch the lesson

Your toolkit: editor, browser and folders · 1/6

Editor + Browser + Folder

You need very little to start: an editor, a browser and a folder.

Prefer a video by a teacher? Find free videos on “vs code setup for web development beginners” on YouTube ↗

In real life: A small business website

A developer building a site for a local coaching centre keeps index.html for the home page, courses.html and contact.html for other pages, one css/styles.css shared by all pages, and an images folder with lowercase names like batch-photo.jpg. When the site goes online, every link keeps working because names and folders are tidy.

Practice (0/2 done)

Task 1 · Practice

Install VS Code (or open a free online editor on your phone). Create a folder called my-site with index.html, css/styles.css and an images folder. Use Emmet (! then Tab) to fill index.html, and open it in your browser.

Task 2 · Code · Javascript

Write a function goodFileName(name) that turns a messy file name into a web-safe one: trim spaces at the ends, make it lowercase, and replace every space inside with a hyphen. Example: " Contact Us.html " becomes "contact-us.html".

Quick quiz

Question 1

1.What should the home page file usually be called?

Question 2

2.Which file name is the safest for the web?

Question 3

3.In VS Code, what does typing ! and pressing Tab in an HTML file do?

Question 4

4.Why can Logo.png and logo.png cause a bug online?

Read more (free)

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

← Previous: HTML, CSS and JavaScript: three jobs