-3

Here's the jsfiddle: jsfiddle.net .html:

  <span class="fileName" >long name file to display long name file to displayddddddssdd moreggggg lines more lines more more more lines</span>

.scss:

.fileName {

  -webkit-font-smoothing: antialiased;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; 

  font-size: 17px;
  line-height:  1.4;
  max-height: 71.4px;


  overflow:hidden;
  display: -webkit-box;
  text-overflow: ellipsis;


  width: 175px;


}

The text will not wrap or truncate in Firefox. But wraps and shows ellipsis in Safari and Chrome.

Is text-overflow: ellipsis; supported in Firefox? I included other parts of scss as I need the text to be shown in 3 lines. So I cannot use display:inline-block or white-space: nowrap; property.

Is there a workaround for Firefox ? Thanks.

Jane
  • 159
  • 2
  • 10

1 Answers1

0

Try:

display: -webkit-box;
display: -moz-box;  // Firefox
display: -ms-flexbox;
display: flex;

I think only old versions Safari use display: -webkit-box;. more info here.

Ted Goas
  • 7,051
  • 1
  • 35
  • 42
  • Thank you for the reference and answer. I modified my question to include the focus on displaying multiple lines and showing ellipsis of text-overflow. With change you mentioned, the `overflow:hidden ` and `text-overflow:ellipsis ` are still not working. – Jane Aug 29 '16 at 20:28
  • Thanks. I notice `.fileName` is a `` (and is `display:inline;` by default), have you tried setting it as `display:inline-block;` or `display:block;` so it maintains any height or width give it? – Ted Goas Aug 29 '16 at 20:39