Perfectly Centered via CSS

By: Justin Braun
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.

Related Articles

Is Your PowerShell Slow to Start?

I ran into a scenario last week where we had loaded the Compellent Storage Center Command Set for Windows PowerShell on a server.

WLW Plugin: Book Info Lookup

I have created my second plugin for Windows Live Writer which is a tool that will do information loo

Date Tracker Sidebar Gadget

I've changed my mind and decided that a Date Tracker will be the Vista Sidebar Gadget that will be the subject of my series on gadget development.