案例效果: 当宽度设定时,HTML超出部分用省略号显示,只需在css中,对该元素加以下代码即可 text-overflow: ellipsis; overflow: hidden; white-space:nowrap;