Advertisement
trentjs

tween on hover - css

Nov 4th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.73 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  
  5. <style>
  6.  
  7.     body{
  8.         background-color: #FFFFFF;
  9.         font-family: Arial, Helvetica, sans-serif;
  10.     }
  11.  
  12.     .divTween{
  13.         background-color: #6666FF;
  14.         color: #FFFFFF;
  15.         cursor: pointer;
  16.         padding: 0.5em;
  17.         max-width: 100px;
  18.     }
  19.  
  20.     .divTween:hover{
  21.         animation: tweenHover 1s forwards;
  22.     }
  23.  
  24.     @keyframes tweenHover {
  25.             0% {
  26.                 background-color: #6666FF;
  27.                 color: #FFFFFF;
  28.             }
  29.             100% {
  30.                 background-color: #3333cc;
  31.                 color: #ffcc66;
  32.             }
  33.         }
  34.  
  35. </style>
  36.  
  37. </head>
  38. <body>
  39.  
  40. <div class="divTween">Roll Over</div>
  41.  
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement