How to make the website on the center

How to make the website on the center

The majority of pages are imposed by means of layers (div) today therefore the problem of alignment of the website on the center of a window of the browser comes down to a problem of alignment of that layer which determines width of visible area of the page. That it was positioned in the middle of a window it is necessary to set the corresponding installations it to a parent, or the most this block. It is required to you • Initial language skills of HTML and CSS Instruction 1. Place a layer which needs to be positioned on the center of a window, between the opening and closing parts of the tag of Center if you want to manage only means of the HTML language (HyperText Markup Language - "hypertext markup language"). Let's recognize that a parent of the layer defining page borders is the body of this page. The simplest version of the HTML-code with use of the tag of Center in this case can look, for example, so: the Page on the center
text of the page
2. Use auto detection of the sizes of an indent from browser window borders if you want to use the CSS language (Cascading Style Sheets - "cascading style sheets") for alignment of the page on the center. The sizes of indents in CSS are defined by the margin parameter. From the previous sample remove tags of Center and add to the style attribute of a layer which determines page width, the margin parameter with value 0 auto: the Page on the center
text of the page
3. Of course, determination of style can be taken out from the style attribute and to place in the external file or in a heading part of the document (between the tags and ). In this case the same code will look, for example, so: the Page on the center
text of the page

Author: «MirrorInfo» Dream Team


Print