Center Multiple DIVs With CSS

July 14th, 2010

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. It would be nice if CSS had a property called “box-align” which you could set to “center” then the child elements would be centered evenly within their parent.

Well, you can achieve something similar by taking advantage of CSS’s flexibity with “recasting” elements (for lack of a better term).

Incoming search terms for the article:

Tags: , , , , , , , , ,

CSS3 Border Radius for Hover States

July 14th, 2010

One of the huge benefits to using CSS3 is the ability to create image-like effects without the use of images. CSS3 gradients, shadows, and rounded corners have helped designers greatly in this area.

While browsing the website of well-known web hosting company Media Temple, I stumbled upon their Labs page and noticed they’re using a block hover effect on the list of items, and the hover state uses (what I assume is) the border-radius property when the background becomes visible.

Incoming search terms for the article:

Tags: , , , , , , , , , , , ,

 
Page 1 of 212