Skip to content

Instantly share code, notes, and snippets.



Created Sep 26, 2014
What would you like to do?
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
.outer {
display: table;
width: 500px;
height: 300px;
border: 1px solid #ccc;
margin: 0 auto;
text-align: center;
*position: relative;
.inner {
display: table-cell;
vertical-align: middle;
*position: absolute;
*top: 50%;
.inner div {
height: 50px;
width: 100px;
display: inline-block;
overflow: hidden;
*display: block;
background: #ccc;
*position: relative;
*top: -50%;
*left: -50%;
<div class="outer">
<div class="inner">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment