Home > Web Front-end > CSS Tutorial > Sets how many seconds or milliseconds a CSS transition effect takes to complete

Sets how many seconds or milliseconds a CSS transition effect takes to complete

WBOY
Release: 2023-09-15 22:49:02
forward
1076 people have browsed it

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

Use the transition-duration property in CSS to set the number of seconds or milliseconds required for the CSS transition effect to complete −

Example

Live Demonstration

<!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>
Copy after login

The above is the detailed content of Sets how many seconds or milliseconds a CSS transition effect takes to complete. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template