i am dustin diaz

a JavaScriptr...

boosh.

don't worry about it.

Centering a webpage without the wrapper div

Whether you knew it or not...still, most don't; you can center a webpage by directly styling the body tag. How is this possible you ask? Well, the sole purpose of the wrapper div is to give IE5 the support it needs to center correctly; so if you're anything like me (or Microsoft) - you're putting an end to your IE5 development. The following method works pefectly in IE6+, Mozilla/Firefox (all), Opera7+, and Safari(all).

Centering a webpage with CSS



body { 

  margin:0 auto;

  width:760px;

  /* adjust width as needed */

}

Voila!

Your page is centered! And yes, it really is that simple.

Todays question and book information

101 CSS Tips Tricks and Hacks
The winner of today’s contest will receive a copy of 101 Essential Tips, Tricks, and Hacksfor CSS by Rachel Andrew. Describe a hypothetical tag-team cage match-up between Jeffrey Zeldman and Molly Holzschlag vs Eric Meyer and Rachel Andrew Please remember to put your answers encapsulated within a <blockquote> element, and the regular discussion as normal. Awaiting some hilarious responses...

this is who i am

Hi, my name is Dustin Diaz and I'm an Engineer @ObviousCorp. Previously @Twitter, @Google, and @Yahoo, author of Strobist® Info co-author of JavaScript Design Patterns, co-creator of the Ender JavaScript Framework, a Photographer, and an amateur Mixologist. This is my website. Welcome!

On this site I write about JavaScript. You can also follow along with my open-source work on Github.

This site is optimized and works best in Microsoft Internet Explorer 6.