overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
再加上宽度限制。
运行测试的网址:
http://www.w3school.com.cn/tiy/t.asp?f=dom_changetext