Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add three dots to text when overflow in html? [duplicate]

Tags:

html

css

How can I show three dots(...) in a text like this? like this?

like image 991
Jonathan Ivgi Avatar asked Apr 15 '16 16:04

Jonathan Ivgi


People also ask

How do I make 3 vertical dots in HTML?

Unicode includes ⠇ which is the Braille symbol for the letter "U". To use, just use the HTML entity ⠇ in your code.

How do I add an ellipsis to a text overflow?

To clip at the transition between characters you can specify text-overflow as an empty string, if that is supported in your target browsers: text-overflow: ''; . This keyword value will display an ellipsis ( '…' , U+2026 HORIZONTAL ELLIPSIS ) to represent clipped text.


1 Answers

Add all these. To make in single line.

text-overflow: ellipsis; white-space: nowrap; overflow: hidden; width:100px; // some width 

To do in multi line which actually you asked.

#content{ overflow: hidden; width:100px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; } 

working fiddle: https://jsfiddle.net/mishrarajesh/676jc7sa/

Please note that this multiline code is supported only in web-kit browsers for now.

like image 98
rajesh Avatar answered Sep 19 '22 02:09

rajesh