首页htmlborderAnimation - 如何为边框宽度设置动画

Animation - 如何为边框宽度设置动画

我们想知道如何为边框宽度设置动画。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
@-moz-keyframes foo {
   from { border:0 solidb lack;}
   to {  border: 20px solid black;}
}
@-ms-keyframes foo {
   from { border:0 solid black;}
   to {  border: 20px solid black;}
}
@-webkit-keyframes foo {
   from { border:0 solid black;}
   to {  border: 20px solid black;}
}
div {
  width: 50px;
  height: 50px;
  border-style: solid;
  -moz-animation: 1s foo infinite alternate;
  -ms-animation: 1s foo infinite alternate;
  -webkit-animation: 1s foo infinite alternate;
}
</style>
</head>
<body>
  <div></div>
</body>
</html>