<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>高级网页设计师博客</title>
<style>
.title a{ color:#f00; display:block; margin:0 auto; width:380px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; /* for IE */ -o-text-overflow: ellipsis; /* for Opera */ }
</style>
</head>
<body>
<div class="title"><a href="">使用css取代程序和js来截取标题长度的好处是加快了调用速度,而且又保证代码里标题的完整性</a></div>
</body>
</html>