Creating an HTML document

An HTML document is a plain text file with an extension .html that contains HTML code. HTML document is otherwise called HTML file.

To make an HTML document from a plain text file (with extension .txt), you need to change the extension from .txt to .html.

There are two ways to open a file saved with the .html extension for viewing in the browser:


  1. Click on it twice with the left mouse button, in this case the HTML document will open in the browser that is selected by default.
  2. Click on it with the right mouse button → move the cursor to open with... → Select the browser.

When the HTML document is received, the browser will display it as a web page (web page is what's displayed in a browser window). Let's take an example. Create an HTML document and place the following HTML code in it:

<!doctype html>
    <meta charset="utf-8">
    <h1>My first headline</h1>
    <p>My first paragraph</p>

Now open the HTML file with the browser. In the browser window, we will not see the HTML code itself, because it will be interpreted to display the contents of the page as it should. The result of this code in the browser window:

моя первая веб страничка

To edit the HTML code of the document, сlick on it with the right mouse button → move the cursor to open with... → and select the desired editor, if the list does not have the correct editor, press Select a program... and select the desired editor. Some editors (for example, take notepad++) can be selected directly from the context menu, by right-clicking on the document and selecting from the top Edit with Notepad++.

How to change a file extension


  1. In the open editor (or in a text document), click file → choose save as → below in the text box file name: write for example: mypage.html → click save. That's it, HTML document created.
  2. Right-click on the text file → choose rename and change the extension from .txt to .html. To use this method, we need to make sure that all files have their extensions available by default, this is done in the following way: open Control Panel → choose Folders settings (in Windows 10, this item is called Explorer Options) → view tab → scroll to the bottom and remove the checkmark hide extensions for registered file types.
Copying materials from this site is possible only with the permission of the site administration and
when you specify a direct active link to the source.
2011 - 2021 © | ruen