需要将div中超出容器部分隐藏并替换成“...”只需要在div的css中加上这么几句代码就可以了。 overflow:hidden; text-overflow:ellipsis; white-space:nowrap;