- From: Brad Kemper <brad.kemper@gmail.com>
- Date: Sun, 15 Jan 2012 10:54:32 -0800
- To: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
- Cc: "www-style@w3.org" <www-style@w3.org>
On Jan 15, 2012, at 6:54 AM, Marat Tanalin | tanalin.com <mtanalin@yandex.ru> wrote:
> Hello. It would be nice to be able to use text-overflow property for _multiline_ (and _multiword_) texts sothat _last_ visible line of text would be clipped same way as it currently happens with single-line texts.
>
> This could be done by specifying maximum number of _lines_ to display (in addition to text-overflow type like 'ellipsis') _without_ making text unwrappable with {white-space: nowrap}:
>
> Possible syntax:
>
> /* 'ln' unit means 'line' */
> DIV {text-overflow: 3ln ellipsis; }
>
> This could be splitted/expanded to following subproperties:
>
> DIV {
> text-overflow-limit: 3ln;
> text-overflow-style: ellipsis;
> }
It seems odd to me to have the text clipping done by something other than an edge of the content box. If you have a measure for number of lines (3ln, above), then why not use that for box height (height: 3ln;)? Then you could have something like 'text-overflow-lines: single | multi', and use it in a shorthand that defaults to 'single'. A new unit based on the height of line-boxes is not strictly necessary for this, and is really a separate issue. Until then, this would suffice to accomplish your main goal, I think:
DIV {
line-height: 1.5em;
height: 4.5em;
overflow: clip;
text-overflow: ellipsis multi;
}
Received on Sunday, 15 January 2012 18:55:27 UTC