Opinions on the under-supported CSS text-align-last

macharborguy's picture

I was wondering what peoples opinions on the very under-supported (IE5.5 and Firefox) CSS feature called 'text-align-center' are.

I am working on a website project and did some text aligning. Left and center just felt off to me (very subjective, i know), and I was liking the result that text-align: justify was producing. There were some larger gaps between words, as justify normally does, but that can alleviated with things like letter-spacing, word-spacing and other font adjustment properties.

However, the last line of a block of text that has been justified always aligns to the left side. From my perspective (again, subjective), I felt as though when I reached the end of the block of text that my vision would slide off further to the left, rather than stay centered, moving down to the next header and block of justified text.

I asked around and then learned about 'text-align-last', which in very few browsers, will adjust how the final line of text in that block is aligned.

Here is an image i made as an example of what I am talking about.

I can see how this could be useful in some situations, but i can also see how this could be problematic in others, both from a design perspective and from a readability perspective.

Just wanted to get some opinions on this. Since there is no real support from most the major browser developers, it looks like its a dead-in-the-water feature that wont be supported into the future, but there are also plenty of niche features in CSS that are available, as well as plenty of hacks to get other things working that CSS wasn't meant to do.

we have things like first-letter, first-line, but nothing really for last-line. I know Chris Coyier of CSS-Tricks.com suggested that a :last-line pseudo element be added in CSS4+ in his article "A Call for ::nth-everything", but while his examples didn't include alignment of specific lines of text in a block, he does think that having more pseudo selectors for different parts of text is always a good idea.

oldnick's picture

Frankly, to my eye, the text-align-last:center example looks screwy, so good luck campaigning for it...

Nick Shinn's picture

In print, I often resorted to increasing the word space in the last line of a justified paragraph. It occurs to me that this could be done by an algorithm that bases last line spacing on an average of the space value for the whole paragraph.

On topic, wouldn't a "justify last line" setting be more useful than "center last line"?

And most obviously, hyphenation!

hrant's picture

What, no "text-align: hourglass_figure"? It would, of course, require three extra parameters.


John Hudson's picture

Or "text-align: poison-chalice" as in a fascist edition of Machiavelli's The Prince that I once had.

oldnick's picture


Everyone knows that the pellet with the poison is in the vessel with the pestle; the chalice from the palace has the brew that is true…


Syndicate content Syndicate content