Answers for "how to use animation css"

CSS
20

css animation

<style>
.my-element {
  width: 100%;
  height: 100%;
  animation: tween-color 5s infinite;
}

@keyframes tween-color {
  0% {
    background-color: red;
  }
  50% {
    background-color: green;
  }
  100% {
    background-color: red;
  }
}

html,
body {
  height: 100%;
}
<style>

<body>
	<div class="my-element"></div>
</body>
Posted by: Guest on May-09-2020
20

css animation

<style>
.my-element {
  width: 100%;
  height: 100%;
  animation: tween-color 5s infinite;
}

@keyframes tween-color {
  0% {
    background-color: red;
  }
  50% {
    background-color: green;
  }
  100% {
    background-color: red;
  }
}

html,
body {
  height: 100%;
}
<style>

<body>
	<div class="my-element"></div>
</body>
Posted by: Guest on May-09-2020
3

animation in css

/* 
========================
   Animation 
========================
animation-name: We have to create our animation "example" etc.
animation-duration:         4s;
animation-delay:            1s;
animation-iteration-count:  4;
animation-direction:        normal/reverse/alternate/alternate-reverse;
animation-timing-function:  ease/ease-in/ease-out/ease-in-out;
animation-fill-mode:        forwards/backward;
*/

@keyframes example {
    from {
        color: #a8dadcff;
    }
    to {
        color: #e63946ff;
    }
}

.animation {
    animation-name: "example";
    animation-duration: 4s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    /* animation-direction: reverse; */
}
Posted by: Guest on May-29-2021
3

animation in css

/* 
========================
   Animation 
========================
animation-name: We have to create our animation "example" etc.
animation-duration:         4s;
animation-delay:            1s;
animation-iteration-count:  4;
animation-direction:        normal/reverse/alternate/alternate-reverse;
animation-timing-function:  ease/ease-in/ease-out/ease-in-out;
animation-fill-mode:        forwards/backward;
*/

@keyframes example {
    from {
        color: #a8dadcff;
    }
    to {
        color: #e63946ff;
    }
}

.animation {
    animation-name: "example";
    animation-duration: 4s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    /* animation-direction: reverse; */
}
Posted by: Guest on May-29-2021
2

how to animate in css

<style>
.myclass{
  background:red; /*DEFAULT VALUE*/
  animation:colorchange 1s; /*ANIMATION PROPERTY [animation name, time duration]*/
}
@keyframes colorchange{
  from{background:red} /*DEFAULT VALUE*/
  to{background:blue} /*CHANGING VALUE*/
}
</style>
<body>
<div class="myclass"> ELEMENT </div>
</body>
Posted by: Guest on March-30-2021
1

css animation

<!DOCTYPE html>
<html lang="en">
   <head>
      <title>CSS Animation</title>

      <style>
         .element {
            height: 250px;
            width: 250px;
            margin: 0 auto;
            background-color: red;
            animation-name: stretch;
            animation-duration: 1.5s;
            animation-timing-function: ease-out;
            animation-delay: 0;
            animation-direction: alternate;
            animation-iteration-count: infinite;
            animation-fill-mode: none;
            animation-play-state: running;
         }

         @keyframes stretch {
            0% {
               transform: scale(0.3);
               background-color: red;
               border-radius: 100%;
            }
            50% {
               background-color: orange;
            }
            100% {
               transform: scale(1.5);
               background-color: yellow;
            }
         }

         body,
         html {
            height: 100%;
         }

         body {
            display: flex;
            align-items: center;
            justify-content: center;
         }
      </style>
   </head>
   <body>
      <div class="element"></div>
   </body>
</html>
Posted by: Guest on February-28-2021
2

how to animate in css

<style>
.myclass{
  background:red; /*DEFAULT VALUE*/
  animation:colorchange 1s; /*ANIMATION PROPERTY [animation name, time duration]*/
}
@keyframes colorchange{
  from{background:red} /*DEFAULT VALUE*/
  to{background:blue} /*CHANGING VALUE*/
}
</style>
<body>
<div class="myclass"> ELEMENT </div>
</body>
Posted by: Guest on March-30-2021
3

what is the animation property in html and css

with the help of animation properties in CSS we can control 
how the animation will be played throughout.

The animation properties in CSS are -
1) animation-duration : implies the time taken by the animation to finish.Forexample- animation-duration: 6s;  
2) animation-direction : implies the direction of the animation.Forexample- the direction in which the horse rides , the car moves , the insects crawls.
3) animation-delay: implies the time after which is the animation starts.Forexample- animation-delay: 3s; means after 3seconds the animation will start.
4) animation-iteration-count: implies how many times the animation will repeat.
5) animation-timing-function: the values can be ease,ease-in, ease-out, linear, ease-in-out.
6) animation-play-state: the values can be paused, running, initial, inherit.
7) animation-name: implies the name of the animation which is assigned by us.
8) animation-fill-mode: it specifies a style for the element when the animation is not playing.The values can be none,forwards, backwards, both, initial and inherit.
9) @keyframes: this is the most important.It specifies the different values of style in different intervals of time.The animation-name is used in @keyframes declaration.

NOTE: the syntax of every single letter, numbers, punctuation mark is very important.
Posted by: Guest on September-10-2020
1

css animation

<!DOCTYPE html>
<html lang="en">
   <head>
      <title>CSS Animation</title>

      <style>
         .element {
            height: 250px;
            width: 250px;
            margin: 0 auto;
            background-color: red;
            animation-name: stretch;
            animation-duration: 1.5s;
            animation-timing-function: ease-out;
            animation-delay: 0;
            animation-direction: alternate;
            animation-iteration-count: infinite;
            animation-fill-mode: none;
            animation-play-state: running;
         }

         @keyframes stretch {
            0% {
               transform: scale(0.3);
               background-color: red;
               border-radius: 100%;
            }
            50% {
               background-color: orange;
            }
            100% {
               transform: scale(1.5);
               background-color: yellow;
            }
         }

         body,
         html {
            height: 100%;
         }

         body {
            display: flex;
            align-items: center;
            justify-content: center;
         }
      </style>
   </head>
   <body>
      <div class="element"></div>
   </body>
</html>
Posted by: Guest on February-28-2021
3

what is the animation property in html and css

with the help of animation properties in CSS we can control 
how the animation will be played throughout.

The animation properties in CSS are -
1) animation-duration : implies the time taken by the animation to finish.Forexample- animation-duration: 6s;  
2) animation-direction : implies the direction of the animation.Forexample- the direction in which the horse rides , the car moves , the insects crawls.
3) animation-delay: implies the time after which is the animation starts.Forexample- animation-delay: 3s; means after 3seconds the animation will start.
4) animation-iteration-count: implies how many times the animation will repeat.
5) animation-timing-function: the values can be ease,ease-in, ease-out, linear, ease-in-out.
6) animation-play-state: the values can be paused, running, initial, inherit.
7) animation-name: implies the name of the animation which is assigned by us.
8) animation-fill-mode: it specifies a style for the element when the animation is not playing.The values can be none,forwards, backwards, both, initial and inherit.
9) @keyframes: this is the most important.It specifies the different values of style in different intervals of time.The animation-name is used in @keyframes declaration.

NOTE: the syntax of every single letter, numbers, punctuation mark is very important.
Posted by: Guest on September-10-2020

Browse Popular Code Answers by Language