Example @keyframe in css

by Luong Dung

HTML

<div class="keyframe keyframe1">
  Keyframe
 <input type="text" name="dung">
</div>

<div class="keyframe keyframe2">
  Keyframe2
 <input type="text" name="dung">
</div>

CSS

* {
  padding: 0;
  margin: 0;
  list-style: none;
  box-sizing: border-box;
}
.keyframe{
  position: relative;
  width: 200px;
  border: 1px solid;
  background: #0056f5;
}

input[type="text"] {
  padding: 3px;
  border: 0;;
  background: #cd004f;
  color: #fff;
  height: 30px;
  line-height: 30px;
  width: 100%;
}
.keyframe1{
    animation:mymove 3s infinite;
}
.keyframe2{
    animation:mymove2 5s infinite;
}

@keyframes mymove{
  from{margin-top:0px;}
  to{margin-top: 40px;}
}

@keyframes mymove2{
  0%{margin-left: 0;}
  20%{margin-left: 10px;}
  60%{margin-left: 30px;}
  100%{margin-left: 50px;}
}