forked from zptcweb/zptcweb.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabc.html
45 lines (44 loc) · 799 Bytes
/
abc.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
figure{
width: 300px;
margin: 100px;
position: relative;
overflow: hidden;
border: 1px solid #000;
}
figure img{
width: 100%;
height: auto;
transition: transform .5s ease-out;
vertical-align: top;
}
figure:hover img{
transform: translate(-30px,40px) rotate(30deg);
/*
CSS的优先级的问题
* */
}
figcaption{
position: absolute;
left: 0;
top: 0;
}
</style>
</head>
<body>
<!--
hover谁 figure
谁做变化 img
之间的通道 img是figure的子元素
-->
<figure>
<img src="image/img/01.jpg" alt="" />
<figcaption>图像标题</figcaption>
</figure>
</body>
</html>