Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS border-top Property Animation</title> <style> .animated { width: 300px; padding: 40px 0; font: bold 46px sans-serif; text-align: center; background: #f5d8f4; border: 2px solid orchid; -webkit-animation: test 4s infinite; /* Chrome, Safari, Opera */ animation: test 4s infinite; } /* Chrome, Safari, Opera */ @-webkit-keyframes test { 50% {border-top: 20px solid indigo;} } /* Standard syntax */ @keyframes test { 50% {border-top: 20px solid indigo;} } </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 border-top properties only the border-top-width, and border-top-color properties are animatable in CSS. The border-style property is not animatable. See the CSS <a href="https://www.tutorialrepublic.com/css-reference/css-border-top-property.php" target="_top">border-top</a> shorthand property for details.<p> <div class="animated">Box</div> </body> </html>