Best way to vertically and horizontally center in CSS with flexible height

· 1 min read

This is from a great article on stackoverflow.com.  Click here Here's the CSS I used:

	//Outer div
	.sidebar-secondary {
	display: table;
	height: 100%;
	width: 100%
	}
	//middle divs
	.sidebar-secondary > nav,
	.sidebar-secondary > div {
	display:table-cell;
	vertical-align: middle;
	}
	//Inner divs
//	nav.nav-secondary .wrap,
	div.widget .widget-wrap {
	margin-left: auto;
	margin-right: auto;
	}