W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: text-oveflow for _multiline_ texts

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sun, 15 Jan 2012 14:06:32 -0800
Message-ID: <CAAWBYDD3QEBfCsydYXY1UESyjMaRzV36E3FugbJEQ+VBRSUWPg@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>, "www-style@w3.org" <www-style@w3.org>
On Sun, Jan 15, 2012 at 10:54 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
> 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;
> }

This isn't *quite* ideal, since a tall image or inline-block could
make one of the lines taller than 1.5em, but this is probably a
corner-case (and such outsized lines should be avoided in any case, as
they're unattractive).

~TJ
Received on Sunday, 15 January 2012 22:07:47 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:48 GMT