How to set up smartphones and PCs. Informational portal

HTML5. Loadable and generated content

What is semantics in HTML

The word "semantics" came to HTML from ordinary linguistic (linguistic) disciplines. There, the concept of "semantics" refers to sections that study the meaning and purpose of human language units. Unlike real human languages, language units do not need to be learned in HTML. In HTML, language units are called "tags" and their purpose is already spelled out in the HTML specification - a single document for all web developers. At the moment, there are several variations on the theme of the HTML specification (depending on the version of the language), but that's not the point. Now, us and this article - something else is important. This is the presence of a clear and intelligible explanation for each language unit - the HTML tag, in the corresponding HTML specification. Thus, if in real human language linguistics, semantics is the study of the purpose of incomprehensible words and concepts, then in HTML, on the contrary, semantics is the correct application and use of ready-made and explained tags.

Semantic layout of a web document

The semantic layout of a web page or the semantic code of an HTML document is a layout with the correct use of HTML tags in accordance with their purpose (semantics). In addition, semantic layout assumes a logical and consistent hierarchy for building the entire web page, in accordance with the laws of the HTML document.

What is the difference between semantic layout and regular layout
The semantic layout of a web document is opposed to the usual one, in which the writing of HTML code is determined only by the appearance of the web page. With semantic layout, a number of page elements have their own tags that directly display their purpose. This is the "semantics" in HTML. So, for example, the structure of a simple web page with a normal layout might look like this:

Site header



Web page content


Then, as with semantic layout, the structure of the same web page will look like:
Site header



Web page content

Site Footer

As you can see from the example, the corresponding tags are used to designate and define the corresponding standard elements of the web page. Other than that, the code is much simpler. At the same time, the appearance of such a page for the human eye will remain absolutely unchanged. A reasonable question arises - why then do we need semantic layout and markup of a web page if it is not visible to people?

Why semantic layout is needed

The semantic layout and markup of a web page is visible to the browser and robots. Semantic layout and markup allows you to more accurately determine the significance of individual elements of a web page and the entire text as a whole. Therefore, first of all, semantic layout is needed to improve the robotic functionality of the site and, as a result, its better search indexing. Isn't that what we all dream about?

Semantic layout in HTML5

The complete furor and revolution of the concept of web semantics occurred with the advent of HTML5.

In HTML4, things were pretty simple. To design web pages written in accordance with semantics, it was enough to use external cascading style sheets (CSS) and a couple of simple innovations, such as replacing tags And on the And . HTML5 is not an example of "more semantic" and this can be seen from the above example.

New popular HTML5 semantic tags

First of all,- a simple and understandable doctype for everyone.

Top Related Articles