[css-text][selectors] Right align only if single line

An author asked me if itís possible to right align if single line, otherwise left align.

She creates a list of quoted articles, and each article has its source like this:

Multiple lines of text text text...
- New York Times, Oct 28th, 2014

She wants the source line be right aligned if single line, but she wants left aligned if more than single line because using right align to multiple lines for this purpose does not look good.

She thought she can do this by:
  text-align: left;
  text-align-last: right;
but since text-align-last applies not only to single line but also the last line of multiple lines, it doesnít work as she expected.

One idea to solve this is to introduce a pseudo selector for single line. I first thought itís not great, since when such selector makes font size smaller and the new result fit into single line, thatís a source of troubles, but then I find we already have :blank, which could be in similar situation if author sets the content property, so Iím guessing itís a needless fear.

The other idea is to add the text-align-single property. I merely remember I had a discussion on this with someone but donít remember well.

Thoughts? Other ideas to solve this better?


Received on Tuesday, 28 October 2014 09:22:45 UTC