运行结果尺寸: 300 x 150
x
 
<!DOCTYPE html>
<html>
<head>
<style> 
#myDIV {
  width: 300px;
  height: 200px;
  background: red url('smiley.gif') no-repeat top left/5px 5px;
  animation: mymove 5s infinite;
}
@keyframes mymove {
  50% {background: blue bottom right/50px 50px;}
}
</style>
</head>
<body>
<h1>背景动画</h1>
<p>逐渐改变背景属性 background:<p>
<div id="myDIV"></div>
<p>背景属性 background 是所有背景属性的简写属性。</p>
<p>background-color、background-position 和 background-size 属性在 CSS 中是<em>动画</em>的。</p>
<p><b>注意:</b>CSS 动画在 Internet Explorer 9 和更早版本中不起作用。</p>
</body>
</html>
×

报个问题: