style.css 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. img {
  2. width: 100px;
  3. height: 100px;
  4. }
  5. .box {
  6. width: 100px;
  7. height: 100px;
  8. background-color: red;
  9. position: relative;
  10. -webkit-animation-name: example; /* Safari 4.0 - 8.0 */
  11. -webkit-animation-duration: 4s; /* Safari 4.0 - 8.0 */
  12. -webkit-animation-iteration-count: 2; /* Safari 4.0 - 8.0 */
  13. -webkit-animation-direction: alternate; /* Safari 4.0 - 8.0 */
  14. animation-name: example;
  15. animation-duration: 4s;
  16. animation-iteration-count: 2;
  17. animation-direction: alternate;
  18. }
  19. /* Safari 4.0 - 8.0 */
  20. @-webkit-keyframes example {
  21. 0% {
  22. background-color: red;
  23. left: 0px;
  24. top: 0px;
  25. }
  26. 25% {
  27. background-color: yellow;
  28. left: 200px;
  29. top: 0px;
  30. }
  31. 50% {
  32. background-color: blue;
  33. left: 200px;
  34. top: 200px;
  35. }
  36. 75% {
  37. background-color: green;
  38. left: 0px;
  39. top: 200px;
  40. }
  41. 100% {
  42. background-color: red;
  43. left: 0px;
  44. top: 0px;
  45. }
  46. }
  47. /* Standard syntax */
  48. @keyframes example {
  49. 0% {
  50. background-color: red;
  51. left: 0px;
  52. top: 0px;
  53. }
  54. 25% {
  55. background-color: yellow;
  56. left: 200px;
  57. top: 0px;
  58. }
  59. 50% {
  60. background-color: blue;
  61. left: 200px;
  62. top: 200px;
  63. }
  64. 75% {
  65. background-color: green;
  66. left: 0px;
  67. top: 200px;
  68. }
  69. 100% {
  70. background-color: red;
  71. left: 0px;
  72. top: 0px;
  73. }
  74. }