對 border-right-width 屬性執行動畫


要使用 CSS 實現border-right-width 屬性的動畫,可以嘗試執行以下程式碼

示例

即時演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 500px;
            height: 300px;
            background: yellow;
            border: 15px solid yellow;
            background-image: url('https://tutorialspoint.tw/latest/cuda.png');
            animation: myanim 3s infinite;
            background-position: bottom left;
            background-size: 50px;
         }
         @keyframes myanim {
            30% {
               background-color: maroon;
               border-right-color: red;
               border-right-width: 25px;
            }
         }
      </style>
   </head>
   <body>
      <h2>Performing Animation for border right width</h2>
         <div></div>
   </body>
</html>

更新日期:25-6-2020

76 次觀看

開啟您的職業生涯

完成課程獲得認證

開始
廣告
© . All rights reserved.