Sunday 20 January 2013

Center a set of images instead of using float:left

I was working on some css today (did I tell you I suck at it?) and I find a tip somewhere that I'd thought I'd share.

The problem:

I had an issue with a couple of icons floating to the left:

http://screencloud.net/v/n58h

but I wanted the icons to be centered on the page instead.

The solution:

Remove the float:left and add in display:inline-block:

The result:

http://screencloud.net/v/3s3u

Problem solved!


No comments:

Post a Comment