-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path001.文字溢出省略号.html
50 lines (44 loc) · 1.5 KB
/
001.文字溢出省略号.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./assets/global.css">
<style>
h1 {
margin-block-start: 0em;
padding-top: 0.67em;
}
.toe {
/* 默认宽度 */
width: 200px;
display: -webkit-box;
overflow: hidden;
word-wrap: break-word;
word-break: break-all;
white-space: normal !important;
text-overflow: ellipsis;
/* 控制行数 */
-webkit-line-clamp: var(--line-clamp, 2);
-webkit-box-orient: vertical;
}
.s-line {
--line-clamp: 1;
}
.m-line {
--line-clamp: 3;
}
</style>
</head>
<body>
<h1>单行👇</h1>
<div class="s-line toe">
11111111111111111111111111111111111111111111111111111111哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇。。。。。。。.................💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛
</div>
<h1>多行👇</h1>
<div class="m-line toe">
11111111111111111111111111111111111111111111111111111111哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇。。。。。。。.................💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛💛
</div>
</body>
</html>