Home > Web Front-end > CSS Tutorial > How to delay transition effects using CSS

How to delay transition effects using CSS

PHPz
Release: 2023-09-01 13:13:02
forward
1553 people have browsed it

How to delay transition effects using CSS

Use the transition-delay property of CSS to delay the transition effect. You can try running the following code to set a 1 second transition delay:

Example

Online Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 150px;
            height: 150px;
            background: blue;
            transition: width 3s;
            transition-delay: 1s;
         }
         div:hover {
            width: 250px;
         }
      </style>
   </head>
   <body>
      <h1>Heading One</h1>
      <p>Hover over the below box to change its width. It begins with a delay of 1 second.</p>
      <div></div>
   </body>
</html>
Copy after login

The above is the detailed content of How to delay transition effects using CSS. 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