用CSS实现超长的字符变成省略号

2023年2月13日09:25:33
<div>xxxxxxxx</div>

通过以下css,可以令div中的超长的字符变成省略号

div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

  • 作者:kyfxbl
  • 原文链接:https://kyfxbl.blog.csdn.net/article/details/40986871
    更新时间:2023年2月13日09:25:33 ,共 108 字。