The world’s largest collection of Original Web Templates, Flash Templates, Print Templates and Graphic Elements

The BoxedArt Guide to Using Website Templates

How Do I Center a Left Justified Website Template Design?

Centering your page in the HTML code:

Open the html web page in a text editor or an html editor (in an html editor go to the view that shows the source code).

Near the top of the code, locate the tag for the main table

Type  align="center"  within the table tag.

File > Save to save your changes.

Centering your page in CSS:

Open the .css file that came with your template in a text editor or html editor

Locate the BODY section (usually near the top).  If there is no BODY section already written, create one.




Within the Body section, type:

margin-left: auto;
margin-right: auto;
text-align: center;

Note: "text-align: center" centers your entire web page, not just text. This line is necessary for many browsers that do not recognize the "margin auto" commands.

File > Save to save the .css file.


Table of Contents