Questions tagged [ellipsis]

An ellipsis is a series of dots, (usually 3, i.e. "…") used to indicate the omission of a word within some text, or more commonly that the preceding text has been truncated.

737 questions
939
votes
20 answers

Limit text length to n lines using CSS

Is it possible to limit a text length to "n" lines using CSS (or cut it when overflows vertically). text-overflow: ellipsis; only works for 1 line text. original text: Ultrices natoque mus mattis, aliquam, cras in pellentesque tincidunt elit…
Peter
  • 5,138
  • 5
  • 29
  • 38
838
votes
14 answers

What does the Ellipsis object do?

While idly surfing the namespace I noticed an odd looking object called Ellipsis, it does not seem to be or do anything special, but it's a globally available builtin. After a search I found that it is used in some obscure variant of the slicing…
Salim Fadhley
  • 22,020
  • 23
  • 75
  • 102
661
votes
18 answers

CSS text-overflow: ellipsis; not working?

I don't know why this simple CSS isn't working... .app a { height: 18px; width: 140px; padding: 0; overflow: hidden; position: relative; margin: 0 5px 0 5px; text-align: center; text-decoration: none; text-overflow:…
ChristopherStrydom
  • 7,338
  • 5
  • 21
  • 34
386
votes
25 answers

Android, How to limit width of TextView (and add three dots at the end of text)?

I have a TextView that I want to limit characters of it. Actually, I can do this but the thing that I'm looking for is how to add three dots (...) at the end of string. This one shows the text has continue. This is my XML but there is no dots…
Hesam
  • 52,260
  • 74
  • 224
  • 365
377
votes
21 answers

Truncate a string to first n characters of a string and add three dots if any characters are removed

How can I get the first n characters of a string in PHP? What's the fastest way to trim a string to a specific number of characters, and append '...' if needed?
Alex
  • 66,732
  • 177
  • 439
  • 641
368
votes
21 answers

css ellipsis on second line

CSS text-overflow: ellipsis on second line, is this possible? I can't find it on the net. example: what I want is like this: I hope someone could help me. I need an ellipsis on the second line of... but what's happening is this: I hope someone…
Reigel Gallarde
  • 64,198
  • 21
  • 121
  • 139
330
votes
23 answers

Applying an ellipsis to multiline text

Is there a solution to add ellipsis on last line inside a div with a fluid height (20%)? I found the -webkit-line-clamp function in CSS, but in my case the line number will be depending on window size. p { width:100%; height:20%; …
Bruno Landowski
  • 3,689
  • 2
  • 16
  • 24
314
votes
16 answers

With CSS, use "..." for overflowed block of multi-lines

with overflow: hidden; text-overflow: ellipsis; white-space: nowrap; "..." will be shown in the end of the line if overflowed. However, this will be shown only in one line. But I would like it to be shown in multi-lines. It may looks…
Ovilia
  • 7,066
  • 12
  • 47
  • 70
288
votes
9 answers

How to have Ellipsis effect on Text

I'm having a long text in my app and I need to truncate it and add three dots to the end. How can I do that in React Native Text element? Thanks
Ran Yefet
  • 3,167
  • 3
  • 15
  • 12
287
votes
18 answers

HTML - how can I show tooltip ONLY when ellipsis is activated

I have got a span with dynamic data in my page, with ellipsis style. .my-class { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; width: 71px; }
Spiderman
  • 9,602
  • 13
  • 48
  • 56
278
votes
18 answers

HTML text-overflow ellipsis detection

I have some elements on my page which have the CSS rules white-space, overflow, text-overflow set, so that overflowing text is trimmed and an ellipsis is used. div { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; border:…
deanoj
  • 3,191
  • 2
  • 17
  • 11
234
votes
5 answers

What is the ellipsis (...) for in this method signature?

In the App Engine docs, what is the ellipsis (JID...) for in this method signature? public MessageBuilder withRecipientJids(JID... recipientJids) What's the function of those three dots?
natchy
  • 2,465
  • 2
  • 15
  • 6
212
votes
5 answers

How to use R's ellipsis feature when writing your own function?

The R language has a nifty feature for defining functions that can take a variable number of arguments. For example, the function data.frame takes any number of arguments, and each argument becomes the data for a column in the resulting data table.…
Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
208
votes
5 answers

What do ellipsis [...] mean in a list?

I was playing around in python. I used the following code in IDLE: p = [1, 2] p[1:1] = [p] print p The output was: [1, [...], 2] What is this […]? Interestingly I could now use this as a list of list of list up to infinity i.e. p[1][1][1].... I…
Aseem Bansal
  • 6,722
  • 13
  • 46
  • 84
207
votes
4 answers

How do you use the ellipsis slicing syntax in Python?

This came up in Hidden features of Python, but I can't see good documentation or examples that explain how the feature works.
miracle2k
  • 29,597
  • 21
  • 65
  • 64
1
2 3
49 50