网格上的CSS DIV布局

Geo*_*oik 3 html css html5

在此输入图像描述

是否可以使用div来获得此布局

Nen*_*car 7

你可以用浮漂和负做到这一点margin-top.e.使用砖石,您不需要margin-top DEMO

* {
  box-sizing: border-box;
}
.content {
  width: 200px;
  height: 200px;
  border: 1px solid black;
}
.item {
  border: 1px solid black;
  float: left;
  display: flex;
  align-items: center;
  justify-content: center;
}
.a,
.d {
  width: 33.3333333%;
  height: 66.67%;
}
.b,
.e {
  width: 66.67%;
  height: 33.3333333%;
}
.e {
  margin-top: -33.3333333%;
}
.c {
  width: 33.3333333%;
  height: 33.3333333%;
}
Run Code Online (Sandbox Code Playgroud)
<div class="content">
  <div class="a item">a</div>
  <div class="b item">b</div>
  <div class="c item">c</div>
  <div class="d item">d</div>
  <div class="e item">e</div>
</div>
Run Code Online (Sandbox Code Playgroud)