Learn HTML Basics

This is not a Government of Canada website

The purpose of this website is to provide a working example of the WET-BOEW-GCWeb theme created by TNG Consulting Inc. together with the Government of Canada for Moodle software . Demo courses are only available in English however multi-language courses are supported.

Naming your HTML file

Go through the activity to the end

HTML file names

An HTML file is simply a text file with an HTML filename extension like index.htm or mypage.html. A filename extension are the letters that appears after the rightmost period, in this case .htm or .html. Most webservers recognize both extensions as equivalent.

File names in Windows are typically not case sensitive. For example, the file name INDEX.HTM, index.htm and Index.HTM as all the same file.

However in OS X as well as Unix/Linux, which is what most web servers use, file names are case sensitive. For example, INDEX.HTM, index.htm and Index.HTM are three different files.

Best practice recommendation is generally to always use lowercase when naming your files and in your links, so that pages that seem to work on your computer continue to work when you copy them onto your web server. And because they are always in lowercase, you will never wonder whether you capitalized your file names.

Other best practices are to only use letters "a" to "z" and numbers 0 to 9 in your file names. Although it is possible to use spaces, accented characters, punctuation marks and other special characters in your file names in most cases, these are harder for people to type and more complicated when creating links to as you would need to convert these special characters into codes which is known as encoding.

Finally, if you want to separate words in your filenames, use a dash (-), not an underscore (_). Search engines like Google understand words when separated by a dash in filenames and may contribute to making your page appear more often in search results. This is part of a process known as Search Engine Optimization (SEO) which is beyond the scope of this introductory course. For now, just remember to use dashes to separate words in file names.

Date modified: