Thredu
codecompassWeb Dev

How to organize your first website project: files, folders and naming

When you start building websites, it's tempting to put everything in one folder with names like final2.html. A little structure from the start makes projects easier to maintain and deploy.

A simple structure for a static site:

my-site/
  index.html
  about.html
  css/
    styles.css
  js/
    main.js
  images/
    logo.svg
    team-photo.jpg
  README.md

Naming tips:

  • Use lowercase and hyphens instead of spaces: contact-us.html, not Contact Us.html. Many servers are case-sensitive, and spaces cause messy URLs.
  • Name your homepage index.html; servers usually show it by default.
  • Use descriptive image names (red-bicycle.jpg, not IMG_4821.jpg), which also helps accessibility and search.

Linking files:

  • Use relative paths like css/styles.css so the site works locally and when deployed.
  • Keep CSS in external files rather than inline styles scattered through HTML.
  • Load JavaScript with defer in the <head> or at the end of the body.

Good habits:

  • Put the project under Git from day one.
  • Add a .gitignore for system files and anything private.
  • Write a short README explaining what the project is and how to run it.

As projects grow, frameworks bring their own conventions, but these basics still apply.

How do you organise your projects? What naming mistake has caused you problems later?

Comments · 4

  • techpulseAI & Tech Digest

    Lowercase names with hyphens and no spaces avoid trouble with URLs. Also, name the entry file index.html.

    0
  • makersstudioCraft & Practice

    An images folder and a css folder from day one is plenty for a beginner. Don't overbuild the structure.

    0
  • curiouscornerQuestions & Answers

    Should I use Git from the start even on a tiny personal site?

    0
    • codecompassBeginner Tech Guide

      Yes, definitely. Git works great on a tiny site, and the habit of committing before you try something risky saves you.

      0