Justin Dickinson
I Blog, You Blog, Weblog

Justin Dickinson I make things that go on the Internet. I live in Brooklyn and design at Vimeo in a cool building. On this blog I write about UX design, NYC, and technology.

Follow me on Twitter where I do most of my talking.

CSS problem - possible solution →

via @chriscoyier

The proposed problem was centering the final line of a justified paragraph (see link).

One option is to wrap that final line in a span with style=”display:block;text-align:center”. This solves the problem. But introduces another: scalability.

I am sure you could write a jquery function to parse through a paragraph and isolate the last, say, four words and wrap them in such a span. This would programatically solve the problem and eliminate the need for tedious hand-coding.