outline-offset - HTML CSS CSS Animatable Property

HTML CSS examples for CSS Animatable Property:outline-offset

Introduction

In the following code the outline-offset property of the div element is animating from its initial value "0" to the "50px", and back to the initial value "0" again up to infinite times.

-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 CSS3 outline-offset Property Animation</title>
  <style type="text/css">
.animated {<!--from  www  .ja va 2  s .c  om-->
  width: 200px;
  padding: 60px 0;
  margin: 100px;
  font: bold 50px sans-serif;
  background: #e6e6fa;
  outline: 10px solid #7d7de6;
  text-align: center;
    -webkit-animation: test 4s infinite; 
    animation: test 4s infinite;
}

@-webkit-keyframes test {
    50% {outline-offset: 50px;}
}

@keyframes test {
    50% {outline-offset: 50px;}
}
</style>
 </head>
 <body>

  <p> </p>
  <div class="animated">
   Box
  </div>
 </body>
</html>

Related Tutorials