Add dots/ellipsis on div/span element overflow without using jquery

前端 未结 5 1022
萌比男神i
萌比男神i 2021-02-04 06:58

Need to implement functionality similar to what dotdotdot jQuery plugin does but cannot use javascript frameworks (like jquery or ext).

Is there an

5条回答
  •  礼貌的吻别
    2021-02-04 07:22

    You could try:

    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    

    This will only work if your elements are not dynamically sized. They will have to have a width set or some other mechanism to keep them from growing to allow more content.

提交回复
热议问题