How to Create An HTML File

HTML files must be identified as HTML files by the file extension with which they are named. There are two file extensions available for HTML files. The most commonly used and recommended extension is ".html", however ".htm" is also an option created back in the early days when some file systems limited file extensions to three letters.

I would not recommend the use of word processors (ie. Microsoft Word, LibreOffice Writer, Abiword, etc.) to save or create HTML files. Text editors such as Notepad or Wordpad on Windows machines, and Kwrite or Kate on Linux machines, are a better option. When saving the file, make sure that you type in the file name and the extension (example: index.html) and that if there is a "Save as Type" dropdown option on the Save menu, that the type is set to "All Files".

(See Example)

Websites have a default landing page called "index.html" or "index.htm'" that is used when no other specific page is requested. This page should always be your website's home page. If you type "http://phpforkids.com/" into your browser's address bar, for example, you will be sent "http://phpforkids.com/index.html" by default. (The fact that you are actually sent to index.php on this site is another matter, covered in our PHP tutorial.)

HTML files can be saved on your own computer and viewed from your browser, however unless they are hosted on a web server they will not be available to anyone else. If your HTML file is uploaded to a web server you can access it from the URL (example: http://www.yourwebsitename.com/index.html). If your HTML file is on your own computer you can open it by double-clicking the file, or by going to "File > Open File" in your browser.