1. Use lowercase only
Most web servers run Linux, which treats Logo.png and logo.png as two different files. Your own computer may forgive the difference, but the live server won’t, and the result will be a broken image.
Cheat sheet #1
A cheat sheet for web design students. If you follow these conventions, your files will work on every server and behave in every browser, and they’ll make sense to the next person who opens your project.
Use lowercase letters, numbers and hyphens, and nothing else.
about-us.html team-photo-2026.jpg main-styles.cssMost web servers run Linux, which treats Logo.png and logo.png as two different files. Your own computer may forgive the difference, but the live server won’t, and the result will be a broken image.
Browsers convert each space in an address to %20, so a name with spaces looks messy in the address bar, and it can easily break links. Replace every space with a hyphen.
This style is known as kebab-case. Search engines read a hyphen as a word break, so web-design-tips is understood as three separate words. Underscores, on the other hand, join words together, so you should avoid them in any name that the public will see in a URL. Bottom line, pick one separator and use it everywhere in the project.
Special characters already have jobs to do in URLs and file systems. For example, a # starts a page anchor, a ? starts a query string, and a / separates folders. That’s why you should leave them out of your names.
Accented and non-Latin characters can be saved differently on different systems, so they may turn up as garbled symbols. It’s safer to use the plain letter instead.
A good name tells you what’s inside the file without you having to open it, so aim for two to four words. Long names are hard to type and hard to read, and that makes them easy to get wrong.
Use the standard extension for the file type, and use the same one every time. For example, choose .html rather than .htm, and .jpg rather than .jpeg. If you stay consistent, your links will never point to the wrong version of a file.
| File type | Use | Avoid |
|---|---|---|
| Web page | .html | .htm, .HTML |
| Stylesheet | .css | .CSS |
| JavaScript | .js | .JS |
| Photo | .jpg | .jpeg, .JPG |
| Graphic with transparency | .png, .webp, .svg | .PNG |
index.htmlWhen someone visits a folder, the server looks for a file called index.html and displays it. So, your home page must be named exactly that, and it must sit in the top folder. The same applies to any subfolder that should open without a file name in the address.
A leading dot hides a file on Mac and Linux systems, and a leading hyphen can be mistaken for a command option. To avoid both problems, always start a name with a letter or a number.
Add a leading zero to numbers so that your files sort in the right order: 01, 02, 10, rather than 1, 10, 2. In the same way, write dates as year-month-day so that they sort by date.
An image name should describe what the picture shows. If you keep several sizes of the same image, add the width to the end of the name. Note that describing the picture in its file name is a different job from writing its alt text, which you still need to add in the HTML.
Names like page-final-v2-REAL.html stop meaning anything within a week. Instead, keep one current file, and use version control such as Git, or a dated backup folder, to keep track of older versions.
Folders follow all the rules above, so use lowercase, no spaces, and hyphens between words. Keep to short, standard names, and try not to nest folders more than three or four levels deep.
The best convention is the one that the whole project follows. Choose a pattern, such as topic-detail-size, and use it for every file. If you join an existing project, copy the pattern that’s already in use.
Once a page is online, other websites, search engines and your own pages will link to it by name, so renaming it will break all those links. If you really must rename a file, update every link to match, and set up a redirect.
| Convention | Rule | Example |
|---|---|---|
| Letter case | lowercase only | gallery.html |
| Word separator | hyphen | photo-gallery.html |
| Spaces | never | photo gallery.html |
| Special characters | never | gallery&news!.html |
| Accents | avoid | galerie-été.html |
| Extension | lowercase, standard | .html .jpg .css |
| Home page | index.html | /index.html |
| Numbered order | leading zeros | 01-intro.html |
| Dates | year-month-day | 2026-10-08-news.html |
| Length | 2 to 4 words | hero-mountains.jpg |
Tip: if an image works on your computer but not on the live site, the first thing to check is the case of the file name.