Last Updated: February 25, 2016
·
215
· 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%">
  <tr>
   <td valign="center" align="center">
      Boom, content.
    </td>
    <td valign="center" align="center">
      Boom, more content.
    </td>
  </tr>
</table>

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.