Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS outline Property Animation</title> <style> .animated { width: 200px; padding: 60px 0; margin: 100px; font: bold 46px sans-serif; background: #e6e6fa; outline: 5px 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: 50px solid #4b0082;} } /* Standard syntax */ @keyframes test { 50% {outline: 50px solid #4b0082;} } </style> </head> <body> <p><strong>Warning:</strong> CSS Animations do not work in Internet Explorer 9 and earlier versions.</p> <p><strong>Note:</strong> Among all the individual outline properties only the outline-width, and outline-color properties are animatable in CSS. See the CSS <a href="https://www.tutorialrepublic.com/css-reference/css-outline-property.php" target="_top">outline</a> shorthand property for details.<p> <div class="animated">Box</div> </body> </html>