There are lots of bad ways to do this – on Stack Overflow, you’ll see a bunch of highly-voted answers that are inline elements with inline-block elements inside them (not great). Here’s my take – might fail on older browsers:

Fiddle