设置 CSS 过渡效果需要多少秒或毫秒才能完成

原创
ithorizon 5个月前 (10-19) 阅读数 29 #CSS

使用CSS中的 transition-duration属性来设置CSS过渡效果完成所需的秒数或毫秒数−

示例

实时演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 150px;
            height: 150px;
            background: blue;
            transition-property: height;
            transition-duration: 2s;
         }
         div:hover {
            height: 200px;
         }
      </style>
   </head>
   <body>
      <h1>Heading One</h1>
      <p>Hover over the below box to change its height.</p>
      <div></div>
   </body>
</html>

以上就是设置 CSS 过渡效果需要多少秒或毫秒才能完成的详细内容,更多请关注IT视界其它相关文章!



热门