How to align the website to the center

How to align the website to the center

At imposition the web master should make considerable efforts that the website equally looked good at different display resolution. An optimal solution is to align all contents to the center of the page. Instruction 1. The way of center alignment depends on a way of imposition. It is possible to use the
or tags. Of course, it is simpler to conclude all contents in a tag
, but it became outdated long ago, and there is no guarantee that everything will correctly work. The most modern way – use of CSS technology. 2. The tag
selects a part of the code in one block, allowing to change a type of contents, setting a fragment one font, color, a background, etc. At block imposition all contents of a tag are placed in a tag
. In
we set alignment by the align attribute. It will look so:
Site content
. 3. Also alignment can be set by CSS. For this purpose it is necessary to create the separate file of stylesheets or to place everything in the same HTML the file, in a tag . The code will look as follows: 4. At tabular imposition the centering is set by means of tables in a tag
. The code will be such:
Site content
. The table will be located on the center of the page, respectively and its contents too. It is also possible to set width of any block, having specified it by means of the width parameter. 5. Selecting page width, do not forget that at users the display resolution can strongly differ from yours. Sometimes, not to be mistaken with a size, it is necessary to set everything in percentage. It is especially convenient if you have a simple website. 6. In whatever way you used, make sure that in all browsers your website works correctly. If it for some reason is incorrectly displayed in one of them – specify it.

Author: «MirrorInfo» Dream Team


Print