div布局实现99本书的书架效果

代码语言:html

所属分类:布局界面

代码描述:div布局实现99本书的书架效果

代码标签: 99 本书 书架 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
  
<style>
body {
  background-color: #dddddd;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.shelf {
  width: 1000px;
  height: 8px;
  background-color: #8b4513;
  border-radius: 5px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 10px solid #dddddd;
  border-top: 80px solid #dddddd;
}
.shelf:hover {
  animation: shelf-lift 0.5s ease;
  animation-iteration-count: 1;
  transform-origin: 50% 50%;
  cursor: pointer;
}
.shelf:hover .book {
  animation: book-bounce 0.5s ease;
  animation-iteration-count: 1;
}

.book {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  border-radius: 2px;
  font-size: 20px;
  overflow: hidden;
  line-height: 15%;
  text-align: center;
  font-weight: lighter;
}

.book:nth-child(0):before {
  content: "";
  color: #111111;
}

.book:nth-child(0) {
  height: 50px;
  animation-delay: 0s !important;
  background-color: #b190a5;
  width: 9px;
}

.book:nth-child(1):before {
  content: "--";
  color: #111111;
}

.book:nth-child(1) {
  height: 68px;
  animation-delay: 0.002s !important;
  background-color: #90b19c;
  width: 11px;
}

.book:nth-child(2):before {
  content: "";
  color: #eeeeee;
}

.book:nth-child(2) {
  height: 47px;
  animation-delay: 0.004s !important;
  background-color: #00b8ff;
  width: 8px;
}

.book:nth-child(3):before {
  content: "---";
  color: #111111;
}

.book:nth-child(3) {
  height: 52px;
  animation-delay: 0.006s !important;
  background-color: #f7850a;
  width: 9px;
}

.book:nth-child(4):before {
  content: "---";
  color: #eeeeee;
}

.book:nth-child(4) {
  height: 41px;
  animation-delay: 0.008s !important;
  background-color: #e9d7c7;
  width: 10px;
}

.book:nth-child(5):before {
  content: "---";
  color: #111111;
}

.book:nth-child(5) {
  height: 56px;
  animation-delay: 0.01s !important;
  background-color: #bada55;
  width: 11px;
}

.book:nth-child(6):before {
  content: "---";
  color: #eeeeee;
}

.book:nth-child(6) {
  height: 65px;
  animation-delay: 0.012s !important;
  background-color: #666666;
  width: 8px;
}

.book:nth-child(7):before {
  content: "";
  color: #111111;
}

.book:nth-child(7) {
  height: 66px;
  animation-delay: 0.014s !important;
  background-color: #489cbd;
  width: 9px;
}

.book:nth-child(8):before {
  content: "--";
  color: #111111;
}

.book:nth-child(8) {
  height: 54px;
  animation-delay: 0.016s !important;
  background-color: #78d663;
  width: 11px;
}

.book:nth-child(9):before {
  content: "";
  color: #111111;
}

.book:nth-child(9) {
  height: 51px;
  animation-delay: 0.018s !important;
  background-color: #90b19c;
  width: 8px;
}

.book:nth-child(10):before {
  content: "--";
  color: #111111;
}

.book:nth-child(10) {
  height: 46px;
  animation-delay: 0.02s !important;
  background-color: #f1ab4f;
  width: 11px;
}

.book:nth-child(11):before {
  content: "";
  color: #eeeeee;
}

.book:nth-child(11) {
  height: 66px;
  animation-delay: 0.022s !important;
  background-color: #78d663;
  width: 10px;
}

.book:nth-child(12):before {
  content: "";
  color: #111111;
}

.book:nth-child(12) {
  height: 45px;
  animation-delay: 0.024s !important;
  background-color: #062542;
  width: 10px;
}

.book:nth-child(13):before {
  content: "--";
  color: #111111;
}

.book:nth-child(13) {
  height: 45px;
  animation-delay: 0.026s !important;
  background-color: #e9d7c7;
  width: 8px;
}

.book:nth-child(14):before {
  content: "";
  color: #111111;
}

.book:nth-child(14) {
  height: 65px;
  animation-delay: 0.028s !important;
  background-color: #55cdfc;
  width: 11px;
}

.book:nth-child(15):before {
  content: "--";
  color: #eeeeee;
}

.book:nth-child(15) {
  height: 48px;
  animation-delay: 0.03s !important;
  background-color: #489cbd;
  width: 10px;
}

.book:nth-child(16):before {
  content: "";
  color: #eeeeee;
}

.book:nth-child(16) {
  height: 43px;
  animation-delay: 0.032s !important;
  background-color: #f6c9b9;
  width: 8px;
}

.book:nth-child(17):before {
  content: "";
  color: #111111;
}

.book:nth-child(17) {
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0