Justin Dickinson
I Blog, You Blog, Weblog

Justin Dickinson I'm Justin Dickinson. I design for FiLife.com, write about How I Met Your Mother and bears, and cook better than your mom.

Follow me on Twitter here 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.