>  기사  >  웹 프론트엔드  >  CSS를 사용하여 전환 효과를 지연시키는 방법

CSS를 사용하여 전환 효과를 지연시키는 방법

PHPz
PHPz앞으로
2023-09-01 13:13:021445검색

CSS를 사용하여 전환 효과를 지연시키는 방법

전환 효과를 지연시키려면 CSS의 transition-delay 속성을 사용하세요. 다음 코드를 실행하여 1초 전환 지연을 설정할 수 있습니다.

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>

위 내용은 CSS를 사용하여 전환 효과를 지연시키는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 tutorialspoint.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제