Why is HTML needed

File names for HTML pages and the correct naming

File names for HTML pages

Every single HTML page needs a file name. A lot can go wrong with these filenames if you don't do a few things. This can save a lot of hassle and even more work. First we look at the file name for the start page and then how file names should be structured in general, before we come to the HTML commands in the next chapter.

File extension .htm or .html

Each file has a file extension. For HTML pages this file extension is "htm" or "html". The .htm comes from the DOS world and .html from the UNIX world.

For a long time, only three-character endings were allowed in the DOS world. To put it badly (and I grew up in the DOS world - the Unix and Linux folks may forgive me) - the extra L doesn't do any harm, but it can cause confusion. Confusion arises when one cannot decide and therefore does not consistently run through one spelling.

So please decide NOW whether you like .html or .htm as a file extension and then always stick with it.

In the course I will only use the short variant with .htm (out of habit and typing laziness).

Filename of the start file of a domain

When we later load our HTML files onto a web server, we can call them up with the corresponding domain name for this server (more on domain names later). In the example of this HTML course, the domain name is the URL https://www.html-seminar.de/

If we enter the URL https://www.html-seminar.de/ in the browser, the browser loads the start page and displays it. Nothing changes in the URL line. Now the question is why is it clear which HTML page is the home page. And here we benefit from the fact that this was simply set (and if no one has tampered with the default settings on the server, this is always the case).

The file index.htm or index.html was set as the start page - one of the two should be available!

The start file should therefore be saved under the file name "index.htm" if possible. Lower case is important, therefore write completely lower case!

Example process: loading the start page

Enter in the browser as URL www.html-seminar.de

The server now searches automatically, because no file was explicitly specified in the URL, whether there is a file index.htm or index.html in the files and delivers this.

The file https://www.html-seminar.de/index.htm loads in the browser and displays it (without adding the file name to the URL - the browser will still be https: //www.html-seminar .de / show - the only thing the browser added is the beginning with https

If the server does NOT find the file, the inquirer may receive a list of the files in the folder or an error page.

Structure of the file names

We usually have more than one HTML page, of course. Therefore, the other HTML pages must be given their own name and this should be assigned correctly from the start.

When naming the file name, you should pay attention to several points:

  1. no umlauts like "äöüß" or other special characters
  2. no spaces in the name, instead a - (minus) or _ (underscore). The minus is more suitable!
  3. the ending (.htm or .html) should always be used consistently for all your HTML files. E.g. always only .htm or always only .html - decide once and stick with it!

good examples:

absolutely not recommended:
all about me.htm
I really big.htm

Absolutely avoid with file names!

  • no spaces
  • no umlauts (öäüß)

I also recommend ...

  • that the file name is completely lowercase
  • and describes the content in a minimalist form

In addition to letters, the minus sign is also permitted.

So I would name our "About Me" page: ueber-mich.htm

Negative example: "About me.htm" may work depending on the browser - but not for everyone :(. The reason is the Ü, which causes problems for visitors outside of Germany at the latest, and the space, which is sometimes not recognized.

Task: Define file name for website

Assign meaningful names to the following small website with 4 pages. The website has a homepage, a page with information about you, a page with your hobbies and a page with your collection of links.

The connecting lines symbolize the possibility for later that you can switch directly to another from each side.

Recommend • Social Bookmarks • Thank you

If you find a bug, please let us know (no matter if typographical or content-related error)

With a mouse Mark the faulty point and take over with the following button:

After submitting it comes here feedback! Please do not send twice. Thanks.