Naming Your Page
Before you name your web page, create a folder to hold all of your web pages. The folder can be anywhere ( a: drive, c: drive, flash drive), it doesn’t mater. Just be sure you know where it is so you can find it again. Name the folder “website”. Now you can save the text file that you just created using Notepad in the folder called “website.” As you save the text file, name it “first.html”.
Naming a web page correctly is easy if you follow these three rules:
- No spaces
- No capitals
- The file extension is .html (that’s dot html)
If you want to know the why behind these rules, read on.
Spaces in filenames can confuse browsers and email programs. Browsers usually substitute “%20” for a space. Email programs sometimes cut off URLs after a space. If you want to use a space for clarity, use an underscore instead. For example, “onion recipe.html” becomes “onion_recipe.html”
Capitals matter. You’re probably creating your first web page in a Windows operating system environment. If so, Windows is pretty lax about file names. But once you’re done creating your page, and you upload it to a server (so that Aunt Tilly in Iowa can see it), the server may be using an entirely different operating system, like Unix or Linux. Unix and Linux care about capitals. MyFile.html is a totally different file than myfile.html in a Unix or Linux environment. You can use capitals in your file names, but when you create your links (which we’ll get to real soon), they won’t work if your link file name doesn’t match your actual file name. If you use all lowercase, you don’t have to try to remember “Did I use a capital or not?”
File extensions. Extensions matter. Your web page extension must be either .htm or .html. It doesn’t matter which, but you’ve got to be consistent. If you create a link to myfile.html and the page is named myfile.htm, the link won’t work.
Ok, now that we’ve saved our first web page with the name “first.html” let’s take a look at it in the browser.
Viewing Your Web Page in a Browser
Now that we’ve created our web page with Notepad, and saved it as “first.html”, we want to see what it looks like in the browser. The easiest way to open a webpage in a browser is to double-click on the filename in “Windows Explorer” or “My Computer.” You can also right-click the name of the file, then choose either “Firefox” or “Internet Explorer.”
There, you’ve done it. You’ve made your first web page, and viewed it in the browser. Don’t worry, we’ll soon learn how to jazz it up.
Candela Citations
- Judy's HTML5 Tutorial. Authored by: Judy Jacobs Miller. Provided by: Extended Learning Institute (ELI), Northern Virginia Community College (NOVA). Located at: http://www.nvcc.edu/home/jumiller/html_tutorial/naming.html. License: CC BY-NC-ND: Attribution-NonCommercial-NoDerivatives