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
109 lines (92 loc) · 1.91 KB
/
index.css
File metadata and controls
109 lines (92 loc) · 1.91 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* =>书写CSS一个相对比较规范的样式编写顺序
* display
* position (top/left/right/bottom/z-index)
* float
* margin
* padding
* width/height
* border
* 文本操作系列的
* 背景操作系列的
* 其它样式
*/
.banner {
position: relative;
margin: 0 auto;
width: 1000px;
height: 300px;
overflow: hidden;
}
/*--左右按钮--*/
.banner .arrow {
display: none;
position: absolute;
top: 50%;
margin-top: -22.5px;
z-index: 999;
width: 30px;
height: 45px;
background: url("../img/pre.png") no-repeat;
opacity: 0.2;
filter: alpha(opacity=20);
}
.banner .arrow:hover {
opacity: 1;
filter: alpha(opacity=100);
}
.banner .arrow.arrowLeft {
left: 20px;
}
.banner .arrow.arrowRight {
right: 20px;
background-position: -45px 0;
}
/*--焦点区域--*/
.banner .focus {
position: absolute;
bottom: 10px;
left: 0;
z-index: 999;
width: 100%;
text-align: center;
font-size: 0; /*取消LI设置DISPLAY=INLINE-BLOCK后之间默认的间距(浏览器会把LI之间的换行和空格算作文本,导致出现间距)*/
}
.banner .focus li {
display: inline-block;
margin: 0 5px;
width: 15px;
height: 15px;
border-radius: 50%;
background: lightblue;
cursor: pointer;
}
.banner .focus li.select {
background: lightcoral;
}
/*--图片区域--*/
.banner .imgBox {
position: absolute;
left: 0;
top: 0;
width: 100%; /*宽度需要在JS中动态计算:总LI的个数 * 1000 */
height: 100%;
overflow: hidden;
}
.banner .imgBox li {
float: left;
width: 1000px;
height: 100%;
background: url("../img/default.gif") no-repeat center center #EEE;
}
.banner .imgBox li a {
display: block;
}
.banner .imgBox li a, .banner .imgBox li a img {
width: 100%;
height: 100%;
}
.banner .imgBox li a img {
opacity: 0;
filter: alpha(opacity=0);
}