css布局实现方块堆叠切片背景效果代码

代码语言:html

所属分类:背景

代码描述:css布局实现方块堆叠切片背景效果代码

代码标签: css 方块 堆叠 切片 背景

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


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

<head>

  <meta charset="UTF-8">
  

  
  
<style>
body {
  background-color: black;
}

main {
  min-height: 100vh;
  min-width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

.box {
  background-color: rgba(60, 110, 255, 0.1);
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.15);
  justify-content: center;
  align-items: center;
  align-self: stretch;
  flex-grow: 1;
  margin: 0.5rem;
  color: #fff;
  transform: rotate(45deg);
}
.box:nth-child(odd) {
  flex-direction: column;
  background-color: rgba(20, 90, 180, 0.05);
}
</style>




</head>

<body >
  <main>
<div class="box">
  <div class="box">
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
  </div>
  <div class="box">
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
  </div>
  <div class="box">
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
  </div>
</div>
<div class="box">
  <div class="box">
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
    <div class="box">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
  <.........完整代码请登录后点击上方下载按钮下载查看

网友评论0