单行溢出:
white-space: nowrap;
overflow:hidden;
text-overflow: ellipsis;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="css/1.css"/>
</head>
<body>
<p>
世界一流大学建设高校,国家“211工程”、“一省一校”重点建设高校,
入选国家“2011计划”、“111计划”、
国家建设高水平大学公派研究生项目、
卓越工程师教育培养计划、卓越法律人才教育培养计划、
卓越医生教育培养计划、国家大学生创新性实验计划、
</p>
</body>
</html>
p{
padding: 0px 2px;
border: black 1px solid;
width: 300px;
height: 30px;
line-height: 30px;
white-space: nowrap;
overflow:hidden;
text-overflow: ellipsis;
}
效果:
多行文本:
将height 设置为line-height 的整数倍。两行即两倍。
p{
padding: 0px 2px;
border: black 1px solid;
width: 300px;
height: 40px;
line-height: 20px;
overflow:hidden;
}