Tutorialspoint

Animate CSS outline-color

With CSS, how can I animate the outline-color property? I want the div to look like the following after
animation:


1 Answer
Nancy Den
, 2 Views

To implement animation on outline-color property with CSS, you can try to run the following code:

Example

Live Demo

<!DOCTYPE html>
<html>
    <head>
      <style>
         div {
            width: 550px;
            height: 350px;
            outline: 2px solid blue;
            animation: myanim 3s infinite;
         }
         @keyframes myanim {
            50% {
               outline-color: orange;
            }
         }
      </style>
   </head>
   <body>
      <h1>CSS outline-color property</h1>
      <div> </div> 
   </body>
</html>
Advertisements