A
A
Anettc2018-10-31 17:35:44
css
Anettc, 2018-10-31 17:35:44

Why doesn't text-overflow: ellipsis; property work? in mozilla?

How to make it so that you get an analogue of text-overflow: ellipsis; for multiline? this is a property that adds an ellipsis to a string if the text doesn't fit in the container. No definitive solution. there is an option with -webkit-box and --webkit-line-clamp, but it doesn't work in Mozilla)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniil Popov, 2018-10-31
@groog

text-overflow работает в связке со следующими свойствами для inline тегов (span и пр.)
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
Пример: https://jsfiddle.net/groog/vo3x7c6w/
Для многострочного этот вариант не подходит, но есть решения на JS
Для ванилы:
https://github.com/glinford/ellipsis.js
https://github.com/josephschmitt/Clamp.js
Для JQ:
https://github.com/jjenzz/jquery.ellipsis

Y
Yuri Bedulin, 2020-10-26
@micro-CMS

.line-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;  
  overflow: hidden;}

found in the translation of the bourgeoisie - checked, but not in the mozilla - it works

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question