CSS3 loadding效果程式碼

antzone發表於2018-07-07

loadding載入效果多種多樣,下面再來分享一個此類小狗。

程式碼例項如下:

[HTML] 純文字檢視 複製程式碼執行程式碼
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>螞蟻部落</title>
<style>
body {
  background-color: #22475E;
  overflow: hidden;
}
div {
  width: 30px;
  height: 30px;
  position: absolute;
  background-color: #ccc;
  top: 45%;
  border-radius: 50%;
}
div:nth-child(1) {
  background-color: #FF5460;
  animation: move 2s infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
}
div:nth-child(2) {
  background-color: #FF9D84;
  animation: move 2s 150ms infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
}
div:nth-child(3) {
  background-color: #F0E797;
  animation: move 2s 300ms infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
}
div:nth-child(4) {
  background-color: #75B08A;
  animation: move 2s 450ms infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
}
@keyframes move {
  0% {
    left: 0%;
  }
  100% {
    left: 100%;
  }
}
</style>
</head>
<body>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>

相關文章