>  기사  >  웹 프론트엔드  >  CSS를 사용하여 왼쪽 애니메이션 효과 페이드 인

CSS를 사용하여 왼쪽 애니메이션 효과 페이드 인

WBOY
WBOY앞으로
2023-09-21 10:09:111228검색

使用 CSS 淡入左大动画效果

이미지에 CSS를 사용하여 왼쪽으로 페이드인되는 큰 애니메이션 효과를 얻으려면 다음 코드를 실행해 보세요. −

Example

Live Demo

<html>
   <head>
      <style>

         .animated {
            background-image: url(/css/images/logo.png);
            background-repeat: no-repeat;
            background-position: left top;
            padding-top:95px;
            margin-bottom:60px;
            -webkit-animation-duration: 10s;
            animation-duration: 10s;
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both;
         }

         @-webkit-keyframes fadeInLeftBig {
            0% {
               opacity: 0;
               -webkit-transform: translateY(-2000px);
            }
            100% {
               opacity: 1;
               -webkit-transform: translateY(0);
            }
         }

         @keyframes fadeInLeftBig {
            0% {
               opacity: 0;
               transform: translateY(-2000px);
            }
            100% {
               opacity: 1;
               transform: translateY(0);
            }
         }

         .fadeInLeftBig {
            -webkit-animation-name: fadeInLeftBig;
            animation-name: fadeInLeftBig;
         }
      </style>

   </head>
   <body>

      <div id="animated-example" class="animated fadeInLeftBig"></div>
      <button onclick="myFunction()">Reload page</button>

      <script>
         function myFunction() {
            location.reload();
         }
      </script>
   </body>
</head>

위 내용은 CSS를 사용하여 왼쪽 애니메이션 효과 페이드 인의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

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