Submit a CSS related link →

Posh CSS

For the modern day web designer.

Center Multiple DIVs with CSS

# Linked to 11 May 2010, 01:43 in by Sam Brown

At some point, you may have a situation where you want to center multiple elements (maybe <div> elements, or other block elements) on a single line in a fixed-width area. Centering a single element in a fixed area is easy. Just add margin: auto and a fixed width to the element you want to center, and the margins will force the element to center.

There really should be a similar simple way to center multiple elements evenly spaced.

Read more at www.impressivewebs.com →

Sam Brown

Sam Brown is a freelance interface designer and web standards developer based in Edinburgh, Scotland. Sam's work can be seen at Massive Blue, blogs at Sam Brown and is on Twitter at @sambrown.