Up until now, you've probably not had to think about how you named your files. When working on the web, different types of computers must work together. This means that certain conventions must be followed.
Always remember to name your file appropriately. Also pay attention to where exactly you are saving your files.
All files (even on a Mac) have a file extension suffix. Make sure when you save you file, that you are using the correct suffix.
.html
.css
.jpg
, .png
, or .gif
, depending on what type of file it is.On a Mac or PC you can save a file called "my awesome website.html
". This is illegal on a website and will not work. Use hyphens in your filenames instead to indicate spaces. Your file would be "my-awesome-website.html
" instead.
Or you can simply avoid spaces altogether. "myawesomewebsite.html
".
Characters such as ?
, %
,#
, /
, :
, ;
, •
, etc are illegal. Only use letters, numbers, underscores, hyphens. Periods should only be used in the suffixes.
Assume that your filenames are always case-sensitive. Uppercase letters and lowercase letters are different. To avoid confusion, it is standard practice to always use lowercase letters.
Try not to make your files names really long. That being said, there is no need to make them so short that they are cryptic. For example, a page about you and what you are doing right now, you don't need to call it about-me-and-what-im-doing-right-now.html
. At the same time, calling it a.html
would be unhelpful. Simply naming the file about.html
is sufficiently clear.