-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path解决1px使用2dp渲染问题.html
76 lines (70 loc) · 2.2 KB
/
解决1px使用2dp渲染问题.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
ul {
list-style: none;
margin-top: 100px;
}
li {
padding: 8px 0 8px 15px;
color: #7c7c7c;
cursor: pointer;
position: relative;
}
li + li:before {
position: absolute;
top: -1px;
left: 0;
content: '';
width: 100%;
height: 1px;
border-top: 1px solid #000;
-webkit-transform: scaleY(0.5);
-moz-transform: scaleY(0.5);
-ms-transform: scaleY(0.5);
-o-transform: scaleY(0.5);
transform: scaleY(0.5);
}
.inaline {
overflow: hidden;
white-space: nowrap;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
}
.intwoline {
display: -webkit-box !important;
overflow: hidden;
/*text-overflow 属性规定当文本溢出包含元素时发生的事情。*/
/*ellipsis 用省略号*/
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
/*box-orient 属性规定框的子元素应该被水平或垂直排列。*/
/*vertical 从上向下垂直排列子元素。*/
-webkit-box-orient: vertical;
/*-webkit-line-clamp:1; 指定溢出行数*/
-webkit-line-clamp: 2;
line-clamp: 2;
}
</style>
</head>
<body>
<ul>
<li>首页</li>
<li>详情</li>
<li>关于我们</li>
<li>地址</li>
</ul>
<p class="inaline">单行文本溢出单行文本溢出单行文本溢出单行文本溢asdfasdfasdfsadfasmsafasdfasdfasdf</p>
<p class="intwoline">多行文本溢出多行文本溢出多行文本溢出多行文本溢出多行文本溢出多行文本asdfdasfasdfasd</p>
</body>
</html>