CSS截取字段,让过长的字段结尾变成省略号(IE有效)
text-overflow:ellipsis;
overflow:hidden;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>测试字段过长结尾变省略号</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="test/css" >
.texthidden
{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
border:1px solid #ddd;
}
</style>
</head>
<body>
<div>123456789</div>
<br>
<div style="text-overflow:ellipsis;overflow:hidden;width:30px">123456789</div>
</body>
</html>