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

text-oveflow for _multiline_ texts

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Sun, 15 Jan 2012 18:54:09 +0400
To: www-style@w3.org
Message-Id: <223981326639249@web33.yandex.ru>
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;
    }

(Expanding is shown here just for additional clarity. Proposal itself is about _multiline_ texts.)

Given that original text is:

    Lorem ipsum dolor sit amet,
    consectetur adipiscing elit.
    Sed ac tempor diam. Suspendisse
    pellentesque ante eu turpis
    commodo vel elementum orci
    aliquam.

Resulting text for example CSS would be displayed next way:

    Lorem ipsum dolor sit amet,
    consectetur adipiscing elit.
    Sed ac tempor diam. Suspe...

Here, we have five-line text, but only three lines are displayed (text-overflow-limit: 3ln), and last line is clipped with ellipsis (text-overflow-style: ellipsis).

Once implemented, this would make text-overflow _much_ more useful and applicable on real-world sites than currently.

Thanks.
Received on Sunday, 15 January 2012 14:55:01 GMT

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