What is the layout of the div when creating a site, its pros and cons

Today, the Internet is part of our lives. Ordinary users are unlikely to think about what path their favorite site took before appearing in search engines on the World Wide Web. The birth of the site begins with the idea of ​​the designer - the artist and the person involved in creating the basic layout. After drawing the layout is fully completed, begins an equally important process - the layout of the site template.

A template or layout is not yet a finished site, it is a certain model created by the designer, on the basis of which a full-fledged site can subsequently be created. From a programming point of view, a template is a set of specific rules for displaying information. An HTML template is usually used to create the simplest static site . HTML is the standard markup language for hypertext (documents) on the Internet.

Layout of the site’s layout is the process of forming its web pages according to the template made by the designer. This type of activity is handled by website typesetter. The main task of the layout designer is to create HTML code that allows you to place text, images and other elements of a web page in certain places of the document and display them in the window of any modern Internet browser according to the layout developed by the designer. During his work, the typesetter must constantly ensure that the part of the layout he composes is equally correctly displayed in all browsers. A few years earlier, the HTML layout of the site was based on the use of tables. Over time, new elements (tags) appear in the HTML language. One of these elements was the div. If over the past years the layout of the div has been most preferable when creating pages on the site, today it is mandatory. Currently, with the help of tables, sites practically do not make up. Instead of the concept of “layout of divs”, the concept of “layout by layers” or “layout by blocks” is most often used.

Div - This is a tag with which a separate piece of HTML code of a page can be selected. This tag is a block element.

The div tag has two main parameters:

  • Align, which allows you to align its contents (on the left, right edge of the page, center or width);
  • Title, which adds a tooltip to its content.

Layout div: main advantages:

  • small markup code compared to table layout;
  • the ability to create a "rubber" page design;
  • fast subsequent loading of pages in the user's browser;
  • facilitation of working with styles (CSS), assigning a style to elements using id.

Layout div: main disadvantages:

  • the inability to display the page correctly in some legacy browsers (IE6);
  • the difficulty of placing blocks on the page and managing them.

Depending on the project being created, a combination of block and table layout is allowed.

Why now, most professionals are moving away from using tables for layout?

In the case of using the table layout of the site, its code is huge, which complicates the further work of programmers on it. In order to find the error made in such HTML code, a relatively large amount of time will be required. The table layout creates an additional load on the web server, thereby slowing down its work, which means slowing down the process of issuing information by the browser. As a result, the page of the site takes quite a while to load.

The layout of the site is an important step in its creation, without it, not even one, even the simplest, Internet resource can do. After the layout is completed, the layout is sent to the hands of web programmers, ensuring its integration into the hosting and implementation in the CMS-system, on which it will be located during its existence.

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


All Articles