CSS 日常练习----照片墙

记录日常 CSS 练习的小知识点 —— 照片墙

照片墙

点击预览

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
<!DOCTYPE html>
<!-- saved from url=(0068)https://gdufedu.github.io/css/%E7%85%A7%E7%89%87%E5%A2%99/index.html -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="study.css">
</head>
<body>
<h1>照片墙</h1>
<div class="container">
<img src="mm1.jpg" alt="" class="pic1">
<img src="mm2.jpg" alt="" class="pic2">
<img src="mm3.jpg" alt="" class="pic3">
<img src="mm4.jpg" alt="" class="pic4">
<img src="mm5.jpg" alt="" class="pic5">
<img src="mm6.jpg" alt="" class="pic6">
<img src="mm7.jpg" alt="" class="pic7">
<img src="mm8.jpg" alt="" class="pic8">
<img src="mm9.jpg" alt="" class="pic9">
<img src="mm10.jpg" alt="" class="pic10">
</div>

</body></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
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
110
h1 {
text-align: center;
}
.container {
position: relative;
width: 960px;
height: 450px;
margin: 60px auto;
}
body {
background: #eee;
}
img {
position: absolute;
z-index: 1;
padding: 10px 10px 15px;
background: #fff;
border: 1px solid #ddd;
transition: .5s;
}
img:hover {
z-index: 2;
transform: rotate(0) ;
transform: scale(1.2);
box-shadow: 10px 10px 15px #ccc;
}
.pic1 {
left: 400px;
top: 0;
transform: rotate(-5deg);
}
.pic2{
top: 0;
left: 600px;
-webkit-transform: rotate(-20deg);
-moz-transform: rotate(-20deg);
transform: rotate(-20deg);
}

.pic3
{
bottom: 0;
right: 0;
-webkit-transform: rotate(5deg);
-moz-transform: rotate(5deg);
transform: rotate(5deg);
}

.pic4
{
bottom:0;
left:300px;
-webkit-transform: rotate(-10deg);
-moz-transform: rotate(-10deg);
transform: rotate(-10deg);
}

.pic5
{
bottom: 0;
left: 0;
-webkit-transform: rotate(-10deg);
-moz-transform: rotate(-10deg);
transform: rotate(-10deg);
}

.pic6
{
top: 0;
left:0;
-webkit-transform: rotate(10deg);
-moz-transform: rotate(10deg);
transform: rotate(10deg);
}

.pic7
{
top: 0;
left: 850px;
-webkit-transform: rotate(20deg);
-moz-transform: rotate(20deg);
transform: rotate(20deg);
}

.pic8
{
bottom: -20px;
right: 630px;
-webkit-transform: rotate(5deg);
-moz-transform: rotate(5deg);
transform: rotate(5deg);
}

.pic9
{
top: 90px;
left: 550px;
-webkit-transform: rotate(15deg);
-moz-transform: rotate(15deg);
transform: rotate(15deg);
}

.pic10
{
left:180px;
top:20px;
-webkit-transform: rotate(-10deg);
-moz-transform: rotate(-10deg);
transform: rotate(-10deg);
}
0%