CSS Transition属性

使用CSS过渡属性将所有四个过渡属性设置为一行。您可以尝试运行以下代码以使用transition属性-

示例

<!DOCTYPE html>

<html>

   <head>

      <style>

         div {

            width: 150px;

            height: 150px;

            background: blue;

            transition: height 3s;

         }

         div:hover {

            height: 250px;

         }

      </style>

   </head>

   <body>

      <h1>Heading One</h1>

      <p>Hover over the below box to change its height.</p>

      <div></div>

   </body>

</html>

以上是 CSS Transition属性 的全部内容, 来源链接: utcz.com/z/316360.html

回到顶部