Home HTML Tips Center a page content both horizontally and vertically

Center a page content both horizontally and vertically

E-mail Print PDF
Some people love this look for their website. While others don't exactly know how to achieve it themselves. We'll show you how you can do this with your website too...

Put your content in a table.

Containing <TABLE> with WIDTH and HEIGHT set to 100%. Establish one cell in one row with ALIGN="center" and VALIGN="middle".

Code:

<HTML>
 <HEAD>
 <BODY>
  <TABLE WIDTH="100%" HEIGHT="100%">
   <TR>
    <TD ALIGN="center" VALIGN="middle">Your beautiful content here</TD>
   </TR>
  </TABLE>
 </BODY>
</HTML>
 

Domain Names

Sample image .com .info
.mobi .net
.org .tv .us
.biz .ws .name
.am .at .be .cc .cn .de .eu
.fm .jobs .jp .ms .nu .nz
.tc .tw .uk .vg .ASIA .ME

Website Hosting

Sample image We're the affordable, reliable place to host your site. And unlike the competition, there's no set up fee and no annual commitment.

24/7 Support

Sample image Our highly trained, courteous support staff is waiting to help. We'll resolve any issue to your complete satisfaction.