Center an Absolute Positioned Div

By Zedric Myers | Published July 30, 2015 | Categories: Web Development

Need to center an absolute div on a page?

This is a simple CSS snippet will auto center an absolute positioned div. There are a few ways, but this bar far is the more simple approach.

.contentBlock {

width: {define width}
position: absolute;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;

}

Contact Us To Find Out More

Have questions? Need help? Contact us and we'll be in touch soon!

* Required

Beacon
164 Thatcher Road
Greensboro, NC 27409
Map and Directions

Sales & Marketing
336.232.5687