Last Updated: February 25, 2016
· zecho

Easily align your layout

This is a common problem. Your site just has a weird ass vertical rhythm. A lot of people would tell you that it's the hardest problem to solve in CSS, and they'd be right.

However, the problem is really easy to solve in HTML.

Check this out in any modern browser with a little bit of effort.

<table width="100%" height="100%">
   <td valign="center" align="center">
      Boom, content.
    <td valign="center" align="center">
      Boom, more content.

Some browsers might not like this, though. Some browsers ignore the height="100%" attribute value (looking at you Chrome). You can fix pretty easily.

If your document has this at the top, above your <html> tag, just delete it:

<!doctype html>

We know it's an HTML document type anyway, because of the "html" filetype extension.