<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS3 outline-offset 属性动画示例- 基础教程(div.cn)</title>
<style>
.animated {
width: 200px;
padding: 60px 0;
margin: 100px;
font: bold 46px sans-serif;
background: #e6e6fa;
outline: 10px solid #7d7de6;
text-align: center;
-webkit-animation: test 4s infinite; /* Chrome, Safari, Opera */
animation: test 4s infinite;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes test {
50% {outline-offset: 50px;}
}
/* Standard syntax */
@keyframes test {
50% {outline-offset: 50px;}
}
</style>
</head>
<body>
<p> <strong>警告:</strong>:CSS动画在Internet Explorer 9和更早版本中不起作用。</p>
<p> <strong>注意</strong>:以下DIV元素的outline-offset属性将从其初始值“ 0”动画化为“ 50px”,然后再次回到初始值“ 0”直至无限大 次。</p>
<div class="animated">Box</div>
</body>
</html>