- From: Brad Kemper <brad.kemper@gmail.com>
- Date: Sun, 15 Jan 2012 15:07:05 -0800
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>, "www-style@w3.org" <www-style@w3.org>
On Jan 15, 2012, at 2:06 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote: > 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). I'm just saying its a separate problem. It could be useful to set a vertical measure (height, min-height, max-height, for instance) to a number of line-boxes tall, so that even if some of the line boxes were taller than the line-height, it would still measure out to the right number of lines. If it was more lines than what the actual contents created, then 'line-height' would be used to determine what 1ln equaled. I believe the request has come up before to have a measurement based on lines or line-height, and this would also allow you to set border-width to that measure (which would equal to line-height of itself). For replaced elements such as images, 1ln could be equal to the height it would take to fit exactly into the line box without increasing the line box height. Once you have a measurement like this, then text-overflow does not need it's own separate way of constraining its height.
Received on Sunday, 15 January 2012 23:08:03 UTC