代码如下:
<html>
<head><title></title></head>
<style>
.title{
width:100px;
white-space:nowrap;
word-break:keep-all;
overflow:hidden;
text-overflow:ellipsis;
}
</style>
<body>
<span class=title>标题显示太长省略多余部分并加省略号的样式</span>
<div class=title>标题显示太长省略多余部分并加省略号的样式</div>
</body>
</html>