Beginner · How the web works · topic 3 of 64 · 20 min
Your toolkit: editor, browser and folders
Explanation
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.
A tidy project folder
my-site/
index.html the home page (servers open this first)
about.html
css/
styles.css
js/
app.js
images/
logo.png- 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.
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.
function extension(fileName) {
return fileName.split('.').pop().toLowerCase();
}
console.log(extension('index.html')); // 'html'
console.log(extension('Logo.PNG')); // 'png'Watch the lesson
Your toolkit: editor, browser and folders · 1/6
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)
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.
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
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.