css3 애니메이션의transition과animation

16739 단어 면접 시험CSS
브라우저 열기 권장

<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Titletitle>
  <style>
    #transition-demo {
      height: 100px;
      background-color: yellowgreen;
      transition: height 1s 0.5s ease-out;
    }
    #transition-demo:hover {
      height: 200px;
    }

    #animation-demo {
      height: 200px;
      animation: 3s type forwards alternate infinite;
      animation-play-state: running;
    }

    #animation-demo:hover {
      animation-play-state: paused;
    }

    @keyframes type {
      from {background: yellowgreen}
      50% {background: yellow}
      to {background: aquamarine}
    }
  style>
head>
<body>
<h1>css3  h1>
<pre><a href="http://www.ruanyifeng.com/blog/2014/02/css_transition_and_animation.html" target="_blank">      a>pre>
<p>   transition   animation  p>
<div id="transition-demo">
  transition  
div>

<h3>transition    h3>
<div>
  <p>transition-property: height; //        p>
  <p>transition-duration: 1s;p>
  <p>transition-delay: 1s;p>
  <p>transition-time-function: ease/linear/ease-in(  )/ease-out/cubic-bezier(   );p>
div>

<h3>transition  h3>
<div>
  <p>0.       ,   block,none p>
  <p>1. transition      ,            p>
  <p>2.    ,      ,      p>
  <p>3.       :       p>
  <p>4.   transition          p>
div>

<div id="animation-demo">
  animation  ,      
div>

<h3>animation    h3>
<div>
  <p>animation-name: rainbow;p>
  <p>animation-duration: 1s;p>
  <p>animation-timing-function: ease-in-out;p>
  <p>animation-delay: 1s;p>
  <strong>animation-fill-mode(     ): none(      )/forwards(  )/backwards(   )/both;strong>
  <p><strong>animation-direction(      ): normal(  )/alternate(    )/reverse(  )/alternate-reverse(      );strong>p>
  <p>animation-iteration-count(    ): 3/<strong>infinite(  )strong>;p>
  <p>steps(10)        p>
  <p>animation-play-state(       <strong>        strong>):running(       )/paused(      );
  <strong>          strong>
  p>
div>
body>
html>

좋은 웹페이지 즐겨찾기