CSS多行文字溢出省略号表示
程序员文章站
2022-07-15 14:50:24
...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS多行文字溢出省略号表示</title>
<style>
div{
width: 150px;
height: 80px;
background-color:pink;
margin:100px auto;
overflow: hidden;
text-overflow: ellipsis;
display:-webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
</style>
</head>
<body>
<div>啥也不说了,此处省略一万字啥也不说了,此处省略一万字</div>
</body>
</html>