Naming files
When building websites, filenames and their locations matter. Think about what you call the file and where you put it. Follow these guidelines to avoid chaos.
Naming files
- No spaces! When saving files for the web, never use spaces. Substitute
underscores_for_spaces
orhyphens-for-spaces
. - In our class, only use
lowercase
letters. NoUPPERCASE
in file names. Capital letters will only make your life harder. - Dots/periods (
filename.jpg
) are fine. - Make sure you include an extension (
.html
,.jpg
,.png
,.css
). - Stay away from other punctation marks or special characters.
Good
index.html
emily.html
emily-portrait-2.jpg
style.css
Bad
photo of emily.jpg
(no spaces!)emily-drawing
(needs an extension)style-copy.css
(use more descriptive names)index2.html
(there should be only one index file)
Sometimes acceptable, but not for our class
Emily_bio.jpg
(use lowercase only)
Terrible
index2 FINAL :) {Illustré par Cybèle?}.HTML
Use a name like this and lots of otters will start crying. You wouldn’t want to make these otters unhappy, would you?