user1576978
user1576978

Reputation: 1755

End line with "..." in CSS

I would like to know the property that I can use to make the interrupted sentences (by width) end with ..., for example:

div { width: 100px;
unknown-property: ...;

}

<div>That is my sentence under 100px </div>

and if the sentence exceeds 100px, that is what happens:

That is my sentence with more...

I hope I could explain.

Upvotes: 1

Views: 2963

Answers (1)

dezman
dezman

Reputation: 19368

Here you go:

text-overflow: ellipsis;

And you may need:

white-space: nowrap;
overflow: hidden;

Upvotes: 8

Related Questions