forked from WangJia-mm/JavaScript201708
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.css
More file actions
53 lines (45 loc) · 1.03 KB
/
Copy pathindex.css
File metadata and controls
53 lines (45 loc) · 1.03 KB
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
html, body {
width: 100%;
overflow-x: hidden;
color: #555;
font-size: 14px;
}
.newsItem {
padding: 10px;
}
.newsItem li {
position: relative;
padding: 10px 0 10px 80px;
border-bottom: 1px dashed #999;
}
.newsItem li div {
position: absolute;
left: 0;
top: 10px;
width: 75px;
height: 60px;
/*图片区域默认占位图*/
background: url("../img/default.jpg") no-repeat;
background-size: 100% 100%;
}
.newsItem li div img {
display: none;
width: 100%;
height: 100%;
/*开始让图片透明度为零,当加载出来后实现一个渐显效果*/
opacity: 0;
filter: alpha(opacity=0);
}
.newsItem li h3 {
line-height: 20px;
font-size: 16px;
/*文字超出一行自动裁切:以下三个属性一个都不能少*/
text-overflow: ellipsis; /*裁切后以省略号代替*/
white-space: nowrap; /*强制不换行*/
overflow: hidden; /*隐藏溢出的内容*/
}
.newsItem li p {
font-size: 12px;
color: #999;
line-height: 20px;
}