Over a million developers have joined DZone.

The Simplest Way To Horizontally And Vertically Center A DIV Using CSS

//to put the 100px * 100px div in the center of the screen, often used for login or thickbox.

.centered_div {
	width: 100px;
	height: 100px;
	position: absolute;
	top: 50%;
	left: 50%;
	margin-left: -50px;       /*half of width*/
	margin-top: -50px;        /*half of height*/
	background: red;

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}