A little bit about how to create an HTML file

Now we will tell you how to create an HTML file , because it is from this that the compilation of the site begins. In order to obtain such a document, you can use a text editor or specialized applications. To achieve the correct display of the file in the browser, you will need to follow certain rules when designing the code.

Definition

how to create an html file
To answer the question of how to create an HTML file, we begin with a definition. Such material is an ordinary text document, but in it using special descriptors you can specify the location of the page content elements relative to individual objects or the browser window. At the same time, you can view the result through an Internet browser.

In order to edit the HTML code, you can use a text editor or select special programs that have automatic input and syntax highlighting functions. Note that an example of an application that is well suited for efficient work with these documents is Sublime Text.

When using the code editor, select β€œFile” in the main menu of the application, and then β€œSave as ...”. Next, in the dialog box that appears, specify the directory in which the HTML file will be saved, as well as its name and exact extension. Thus, the format is easy to change.

You can convert a text document by turning it into an HTML page by simply appending the .html extension at the end of the name. It should be remembered that there are a number of certain situations in which even a correctly created file that has the correct format does not open in the browser. The reason for this may be the incorrect design of the structure of HTML-code.

rules

create html file
There are a number of rules, without full compliance with which the Internet page does not display correctly or does not open at all. If you want to know how to create an HTML file without errors, there are a few recommendations to keep in mind. The <DOCTYPE!> Tag is optional, but its presence will help the browser correctly interpret the received code, as well as recognize the specified structure of the document.

In certain situations, the cause of incorrect display of a web page is the absence or incorrect spelling of this tag. The paired <html> </html> code is a descriptor. It contains the entire contents of the web page. At the same time, material elements that are located outside the given tag are displayed in plain text or blocked by the browser.

The exception is <DOCTYPE!>. If we talk about how to create an HTML file, it is important to know that the handle of the same name is required for this type of material. Moreover, such a designation cannot be used as a tag more than 1 time on the page. The special symbols <head> and </head> indicate information regarding the document.

Note that between the tags using the <title> and </title> descriptors, you must specify the title of the web page. In turn, via <link> you can connect JavaScript or CSS files.

Similarly, inside the <head> parameter, the document type, encoding, styles, design versions in different browsers, as well as a number of other parameters are given. Although the contents of the tag are not displayed by the browser, this descriptor is required.

The foundation

html file
The <body> tag together with </body> encompasses the body of the site - information that is displayed on the user's screen. This may include headings, subheadings, paragraphs and lines of text, images, videos or other multimedia objects. In this case, the specified descriptor is required.

Other elements can be applied inside: <footer>, <article> or <header>. Although they do not directly affect the result displayed in the browser, however, they create the structure of HTML code, it is considered to be a good form among web developers and layout designers.

Notebook at hand

how to create an html file in notepad
Now we’ll look at how to create an HTML file in Notepad. It was with the development of HTML pages in this application that all web programmers began teaching site building. You can also master such a simple science. To fill in Notepad with information should be based on the tips that were given earlier, that is, examine the meaning of tags, place them in the right places, fill them with content.

Turning Notepad into an HTML page is very simple, as we already described. This way you familiarized yourself with the basics of the process, and you might agree that creating an HTML file is not very difficult.

Source: https://habr.com/ru/post/C43204/


All Articles