实例代码“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: 50%;
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-width: 800px;}
19
}
20
21
/* Standard syntax */
22
@keyframes mymove {
23
    50% {min-width: 800px;}
24
}
25
</style>
26
</head>
27
<body>
28
29
<p>逐步改变 max-width, 从 "none" 到 "800px":<p>
30
<p><strong>注意:</strong> min-width 属性会覆盖 width 属性。</p>
31
32
<div id="myDIV">
33
  <p>This DIV element has a pre-defined width: 50%.</p>
34
  <p>An animation will gradually change the min-width to 800 pixels.</p>
35
</div>
36
37
<p>min-width 属性支持动画效果。</p>
38
<p><b>注意:</b>Internet Explorer 9 及更早 IE 版本不支持 CSS 动画。</p>
39
40
</body>
41
</html>