HTML body: concept, all document content and browser viewing area

An HTML document is head and body. The first contains descriptive tags, the second includes the layout, content and functionality of the page. Both components are essential, and their content determines the design and logic of the page, comfort for the visitor, the load on the communication channels and the “interest” of search engines.

An HTML document is text formalized in a specific way. HTML rarely works as a single file. Usually it is supplemented with files of CSS-rules, JavaScript-scripts, drawings, texts and other resources. When using the popular content management system (CMS), the body of the document is formed automatically: the developer may not even know how HTML / CSS is structured, where and how exactly JavaScript is used.

Browser and HTML document

The browser is a special program that can display the hypertext language, apply CSS styles, execute JavaScript code and perform many other functions that ensure the work of visitors and applications on the Internet. In fact, the browser is:

  • a window into the Internet for the visitor;
  • engine for working with HTML / CSS stream through JS and applications (extensions);
  • A browser is an area for viewing and entering information for a site developer.

A large number of browsers are developed. The advent of mobile devices has greatly complicated the "life" of web resource developers. The viewing area of ​​different browsers and their versions is different. The viewing conditions are different. This created many problems and made urgent the task of developing responsive sites.

Solutions for displaying the desired HTML body content tag in an accessible area on any device have themselves become a sought-after product. The development of hypertext has made it necessary to use the head tag to clarify and additional description to be displayed in the content viewing area.

A program that understands HTTP / HTTPS

Any program that is capable of recognizing a hypertext standard, especially HTML and CSS, can act as a browser. A plain text editor can display the contents of any HTML file. A browser or a similar program is built on some debugged engine, but this is not a prerequisite.

Browser, text and HTML content

You can "open" the body of an HTML document in a regular notepad. Here the concepts are body and text = HTML text, not an HTML page. In a text editor, it will be just text. Another effect that can be obtained:

  • in the word processor MS Word;
  • Popular browser
  • professional editor HTML / CSS / JavaScript / PHP;
  • content management system that works outside the browser.

If we talk about the usual popular content management system, the viewing / development area of ​​a web resource may be narrower than that of a browser, but it will be equipped with much more functionality.

A program that understands the Internet protocols may not display anything from the HTML file: head + body, but perform all the functions of all the tags that are written to them.

An HTML page can focus on management rather than display. The Internet is only in the views of developers and site visitors a window into the vastness of the World Wide Web. In fact, this is a set of data transfer protocols and ideas on how to formalize information for its use.

HTML: description and body + title

The page contains three components: HTML = head + body + title. The browser will display everything that came to it according to the protocol, but it will “seriously and with interest” refer only to that data stream that contains the correct content for each of these three components.

HTML: Top Positions

The browser viewing area will be filled correctly if the description tags correspond to the body tags and all necessary external files are connected. The title tag title is not displayed, but it is used as a unique short description of the page by the browser and search engines. All three elements are important. It is very important to write down all three elements correctly.

An HTML page is just text, but text designed in a strictly defined way. The contents of the page can be edited in any text editor. You can develop site content in a specialized editor, it is much more practical, since HTML is not just text, but content, that is, graphics and text filed according to the display rules in the browser viewing area.

Good manners

Information on what to write in the head, body and title tags of any HTML page can be found abundantly on specialized sites on the Internet. It is important to distinguish between tasks:

  • process management;
  • display content.

In the first case, nothing will be displayed at all, but something will definitely be done. For example, you need to transfer information to a robot operating on a conveyor belt or to an unmanned aerial vehicle for an approach taking into account the latest weather forecast. There is nothing to display and no reason. But in both cases, the HTML interface from the control center can send control algorithms via HTTP / HTTPS. It is modern.

HTML control and display

In the second case, more than one team of designers, several generations of programmers and a dozen top managers can work on an HTML page. If we are talking about creating a site for the opera and ballet theater, a web resource for the remote control of passenger traffic by Aeroflot airplanes or electronic document management of a large company ... Without thoughtful content, without a system of rules for displaying information and the logic of organizing dialogue, you can not do here.

In any case, the HTML body is the correct content, and the HTML head is the correct description of the content. The title of the HTML document title indicates what kind of page got into the browser and how exactly the search engine should index it.

The combination of body + head and the principle of "nesting dolls"

Hypertext language, in fact, two elements:

  • single tag;
  • pair tag.

There are additional variations and ideas, but these are the main types of content elements. HTML tags can have attributes, parameters, values, description rules, and something else, but most importantly, they can be:

  • id;
  • class.

It is fundamentally. The CSS identifier (id) describes a unique tag, but this does not mean that a single id cannot be assigned to hundreds of tags. The CSS description of a class, by contrast, is oriented toward multiple uses. Classes can be combined and allow the developer to combine content descriptions.

External style and script files are one of the important reasons for using body descriptions and links from the head in the HTML body. Similarly, external files of pictures, texts and other resources are used.

The principle of nesting dolls

The description of a single tag does not cause additional problems, the use of a paired tag should be strictly according to the rules. Paired tags are embedded in each other, like nesting dolls. You cannot break paired tags into components. Any tag is a complete entity, which is represented in the body as a single entity.

You can not write:

  • “A” “p” is the content of the & laquo; / a ”“ / p ”tag in the body of the HTML page.

You can write only this:

  • “P” “a” the content of the tag “/ a” “/ p”

An interesting point: when the matryoshka was invented, the inventor did not even assume that he had created an objective rule for writing HTML content to the body. Surprisingly, the developers of the hypertext standard did not even know that the nested doll was created much earlier, and its creator already knew one of the unshakable rules for writing the correct content of an HTML page.

Correct html

Using the popular CMS (content management system) removes all problems. A developer may not be a programmer and know nothing about HTML, body, head, title, and hundreds more two tags and rules that can be written in the body of the document that makes up the site.

Correct and working HTML

When developing a site manually, you need to objectively and accurately approach the study of the basic concepts of the hypertext language and learn how to use them correctly.

This is enough to make good, and after a while professional sites.

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


All Articles