Perfectly Centered via CSS

Posted on February 8, 2010

One thing that has always been a struggle is how to perfectly center an object (for example, a DIV) both horizontally and vertically on a page. 

The other night I was searching for a better way to do this via CSS instead of using nested tables.  I came across Dead Centre, a website that demonstrates exactly how to accomplish this.  You can see some of the detail on the webpage itself, but also take a look at the source for more details on how this was executed.

This provided a truly dynamic design that was 100% CSS-based and works across all browsers.

One comment on “Perfectly Centered via CSS”

About JB

I've been a technologist for over 20 years, getting my start in IT with a large Fortune 100 international retailer in the 1990s. I love to talk about new technology, mobile devices, software development, photography, and the weather.  The opinions expressed on this blog are my own.

Follow me

Copyright © Justin Braun.  All rights reserved.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: