How can I show dots (“…”) in a span with hidden overflow?

后端 未结 8 1317

My CSS:

#content_right_head span
{
  display:inline-block;
  width:180px;
  overflow:hidden !important;
}

Now it\'s showi

相关标签:
8条回答
  • 2020-12-02 04:45

    You can try this:

    .classname{
        width:250px;
        overflow:hidden;
        text-overflow:ellipsis;
    }

    0 讨论(0)
  • 2020-12-02 04:46
     var tooLong = document.getElementById("longText").value;
        if (tooLong.length() > 18){
            $('#longText').css('text-overflow', 'ellipsis');
        }
    
    0 讨论(0)
提交回复
热议问题