html, body { height: 100%; } html { display: table; margin: auto; } body { display: table-cell; vertical-align: middle; }