Responsive Script To Center List Items

25 Jun 2012

I was recently assigned the task of creating a webpage with some list items that we're centered within a container. Easy enough to do, just create a row of list items and set the margin to auto so it will always be in the center. Turns out, not so simple. I was asked to make the list items responsive, so when the page was made smaller, the list items reshuffled themselves and become centered again.

The result of this was a responsive script that centers list items when the page is resized. You can download the script from the demo or download this zip file which has the example included.

See the demo

Download zip