<html>
<head>
<title>过长的字符如何使用CSS隐藏?</title>
<style type="text/css">
b{
width:100px;
display:inline-block;/*行内元素必须添加此属性,宽度设置才能有效*/
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
</style>
</head>
<body>
<b>sdfsdfdsfdsgfdgfdagdfgadfhgdhghgshdfgdsfgdfgsdfgdfsfd</b>
</body>
</html>
运行结果