html/CSS Ellipsis

前端 未结 1 640
心在旅途
心在旅途 2021-01-03 14:39

I\'m trying to get an ellipsis to work like so: http://jsfiddle.net/583mK/1/

Interestingly, it works fine on jsFiddle. Strange thing is given the exact same HTML/CSS

相关标签:
1条回答
  • 2021-01-03 15:10

    Not sure if this helps:

    http://quirksmode.org/css/textoverflow.html

    Support is not provided in Firefox. The Mozilla developers think there are too many edge cases involving r-to-l languages etc to implement safely, yet.

    Firefox now supports text-overflow: ellipsis starting with version 7 (source). Hurray!

    All I know is that you need all these rules:

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    

    and it should have width (not an inline element).

    Also, use your favourite browser developer tools to check you are not inheriting a property that conflicts.

    0 讨论(0)
提交回复
热议问题