outline - HTML CSS CSS Animatable Property

HTML CSS examples for CSS Animatable Property:outline

Introduction

Only the outline-width, and outline-color properties are animatable in CSS among all the individual outline properties.

-webkit- prefix is for Chrome, Safari, Opera.

-moz- prefix is for Firefox.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head>
  <title>Example of CSS outline Property Animation</title>
  <style type="text/css">
.animated {<!--from   w  w  w  .  ja  v  a 2s  .  c om-->
  width: 200px;
  padding: 60px 0;
  margin: 100px;
  font: bold 50px sans-serif;
  background: #e6e6fa;
  outline: 5px solid #7d7de6;
  text-align: center;
    -webkit-animation: test 4s infinite; 
    animation: test 4s infinite;
}

@-webkit-keyframes test {
    50% {outline: 50px solid #4b0082;}
}

@keyframes test {
    50% {outline: 50px solid #4b0082;}
}
</style>
 </head>
 <body>
  <p> </p>
  <div class="animated">
   Box
  </div>
 </body>
</html>

Related Tutorials