TGViewer
Web Development Web Development @webdevcoursefree ยท 79.6K subscribers
Post #4052 1.4K
๐ŸŒ Web Development Roadmap โ€” Part 11

๐Ÿ“ Files, Folders & Project Structure

Before we start writing HTML

, CSS, and JavaScript, you need to understand how a web development project is organized.

A website isn't usually one giant file. A real project contains multiple files and folders, each with a specific purpose.

1๏ธโƒฃ What Is a File?

A file is a container that stores information.

In web development, you'll commonly work with files such as:

.html

.css

.js

.json

.ts

.jsx

.tsx

For example:

index.html

style.css

script.js

Each file can have a different responsibility.

2๏ธโƒฃ What Is a Folder?

A folder is used to organize files and other folders.

For example:

my-website/
โ”‚
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ style.css
โ”œโ”€โ”€ script.js
โ”‚
โ”œโ”€โ”€ images/
โ”‚ โ”œโ”€โ”€ logo.png
โ”‚ โ””โ”€โ”€ profile.jpg
โ”‚
โ””โ”€โ”€ pages/
โ”œโ”€โ”€ about.html
โ””โ”€โ”€ contact.html


Here:

my-website/

is the main project folder.

Inside it are files and additional folders.

3๏ธโƒฃ Why Do We Need Project Structure?

Imagine putting every file for a large application into one folder without organization.

You might eventually have:

100+ files

Finding the correct file would become difficult.

A good structure makes it easier to:

Find files

Understand the project

Maintain code

Work with other developers

Scale the application

4๏ธโƒฃ The Basic Website Structure

For a beginner website, you can start with:

my-website/
โ”‚
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ style.css
โ””โ”€โ”€ script.js


Each file has a different job.

index.html

Contains the webpage structure.

<h1>My Website</h1>
<p>Welcome to my website.</p>


style.css

Controls the appearance.

h1 {
color: blue;
}


script.js

Adds behaviour.

console.log("Website loaded");


The browser can connect these files together.

5๏ธโƒฃ The index.html File

You'll see index.html very often.

It is commonly used as the main or default HTML page of a website.

For example:

my-website/
โ”‚
โ””โ”€โ”€ index.html


When someone visits the main page of a simple website, the server may serve the index.html document.

It's a convention rather than a universal rule for every web application.

6๏ธโƒฃ Organizing Images

Instead of putting every image directly in the project root, we can create an images folder.

my-website/
โ”‚
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ style.css
โ”œโ”€โ”€ script.js
โ”‚
โ””โ”€โ”€ images/
โ”œโ”€โ”€ logo.png
โ”œโ”€โ”€ laptop.jpg
โ””โ”€โ”€ phone.jpg


Then HTML can reference an image inside that folder.

<img src="images/logo.png" alt="Logo">


The path:

images/logo.png

tells the browser where the image is located relative to the HTML file.

7๏ธโƒฃ Multiple Pages

A website can contain multiple HTML pages.

For example:

my-website/
โ”‚
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ about.html
โ”œโ”€โ”€ contact.html
โ”‚
โ”œโ”€โ”€ css/
โ”‚ โ””โ”€โ”€ style.css
โ”‚
โ””โ”€โ”€ images/
โ””โ”€โ”€ logo.png


You could have:

index.html โ†’ Home

about.html โ†’ About

contact.html โ†’ Contact

This is a simple way to understand how multi-page websites are structured.

8๏ธโƒฃ Relative Paths

Understanding file paths is extremely important.

Suppose you have:

project/
โ”‚
โ”œโ”€โ”€ index.html
โ”‚
โ””โ”€โ”€ images/
โ””โ”€โ”€ logo.png


From index.html, you can reference the image using:

<img src="images/logo.png">


Now suppose you have:

project/
โ”‚
โ”œโ”€โ”€ pages/
โ”‚ โ””โ”€โ”€ about.html
โ”‚
โ””โ”€โ”€ images/
โ””โ”€โ”€ logo.png


From about.html, you need to go up one folder first:

<img src="../images/logo.png">
  • โค 5
More from @webdevcoursefree
  1. Oct 5, 2026The browser reads the HTML structure and builds the webpage from these elements. Key Takeaโ€ฆ
  2. Oct 5, 2026๐ŸŒ Web Development Roadmap โ€” Part 13 HTML Syntax, Tags & Elements Now that you understandโ€ฆ
  3. Sep 29, 2026It can contain things such as: โ€ข Page title โ€ข Metadata โ€ข Links to CSS โ€ข Other informationโ€ฆ
  4. Sep 29, 2026๐ŸŒ Web Development Roadmap โ€” Part 12 ๐Ÿ—๏ธ HTML โ€” What Is HTML and Why Do We Need It? HTML iโ€ฆ
  5. Sep 29, 2026๐—™๐—ฅ๐—˜๐—˜ ๐—ฅ๐—ฒ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ๐˜€ ๐—ง๐—ผ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป ๐—”๐—œ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ๐Ÿš€ โ€‹ Explore 6 free resourceโ€ฆ
  6. Sep 28, 2026Post #4062
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’