Skip to content

BARREL | Text-align: Justify and RWD barrelny.com · Archived on · Originally posted on Pinboard

By simply applying ‘text-align: justify’ to the container, and giving the child elements ‘display: inline-block’ and a percentage width, you’ll never have to deal with horizontal margins ever again! (Oh and did I mention, when using this trick, you’ll also never need to use float on your elements ever again, so you can wave goodbye to those ignominious clearfixes and clear divs too!)

Clever, mildly hacky.