|
Layout of a website is one of important stages of website development. There are different kinds of website layout which are classified according to many factors and criteria. In particular, the so-called DIV-based layout of sites is very popular.
DIV-based layout of websites, or just DIV layout, has been used most often recently. DIV-based layout is a kind of html layout of websites; it uses the following syntactic construction:
<div id="block1">content of block 1</div>
<div id="block2">content of block 2</div>
<div id="block3">content of block 3</div>
...
|
<div> tag is the so-called container (block) which can contain formatted text, images etc. An important feature of blocks is their ability to overlay. This feature provides blocks with wider opportunities as far as layout of websites is concerned than, for example, tables.
DIV-based layout actively uses CSS for flexible and convenient formatting of elements of web pages. With the help of CSS you can specify the arrangement of containers on the page, necessary indents and standoffs, font color, font size and many other elements accurate within a pixel.
DIV-based layout of a site has a lot of advantages. Here are only some of them:
- containers can be easily moved or hidden without refreshing the whole page; it permits to get dynamic effects (pull down menu, tooltips etc);
- DIV-based layout of a site is convenient for getting flexible (liquid, fluid, elastic...) web design as containers can be easily positioned relative to window borders of a browser, overlay etc;
- DIV-based layout allows to get rid of transparent single pixel images which are used to get fixed distance between the table cells in table-based layout;
- DIV-based layout of a site helps to get more intelligible and compact program code; it is considered that a page with DIV-based layout loads quicker than a page with table-based layout (though it is not always true).
However along with all its advantages DIV-based layout also has certain disadvantages. For instance, DIV-based layout makes the task of ensuring of cross-browser compatibility more complicated as different browsers interpret html code of DIV-based web pages in different ways.
That is why DIV-based layout of websites is often used in combination with table-based layout. In this case the use of every type of website layout for solving concrete tasks is much more preferable. For instance, very often the “framework” of a page is set with the help of table-based layout, and the cells of the table are filled with necessary containers.
Therefore, DIV-based layout is not strictly obligatory. It should be used as the need arises. Professional layout of a website, whether it is DIV-based or table-based, is always displayed correctly in different browsers (i.e. it is cross-browser), does not contain unnecessary code and favors quick load of pages.
TAGS
div-based layout,
div layout,
table-based layout,
html layout,
cross-browser |