body { display: table; } .my-block { text-align: center; display: table-cell; vertical-align: middle; }