实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta charset="utf-8"> 
5
<title>手册网(www.shouce.ren)</title> 
6
<style> 
7
#myDIV {
8
    width: 500px;
9
    background-color: lightblue;
10
    overflow: auto;
11
    border: 1px solid black;
12
    -webkit-animation: mymove 5s infinite; /* Chrome, Safari, Opera */
13
    animation: mymove 5s infinite;
14
}
15
16
/* Chrome, Safari, Opera */
17
@-webkit-keyframes mymove {
18
    50% {min-height: 400px;}
19
}
20
21
/* Standard syntax */
22
@keyframes mymove {
23
    50% {min-height: 400px;}
24
}
25
</style>
26
</head>
27
<body>
28
29
<p>逐步改变 max-height, 从 "none" 到 "400px":<p>
30
<div id="myDIV">
31
  <p>This DIV element does not have a pre-defined height.</p>
32
  <p>An animation will change the min-height, from "none" to "400px".</p>
33
</div>
34
35
<p>min-height 属性支持动画效果。</p>
36
<p><b>注意:</b>Internet Explorer 9 及更早 IE 版本不支持 CSS 动画。</p>
37
38
</body>
39
</html>