<div class="mannaka">
<!-- margin auto で真ん中 -->
<div class="soto1">
<div class="box1">margin<br>auto</div>
<div class="box1-1">違うボックス</div>
</div>

<div class="soto2">
<div class="box2">margin<br>0 auto</div>
  <div class="box2-1">違うボックス</div>
</div>


<div class="soto3">
<div class="box3">margin<br>0 auto 0 auto</div>
  <div class="box3-1">違うボックス</div>
</div>
</div><!-- mannaka -->


<!-- margin 70px -->
<div class="outline">
<div class="box4">margin 70px</div>
</div>

<!-- margin; 30px 40px -->
<div class="outline2">
<div class="box5">margin<br>30px 40px</div>
  <div class="box5-1">box横</div>
</div>

<!-- margin: 40px 45px 50px; -->
<div class="outline3">
<div class="box6">margin<br>40px 45px 50px</div>
  <div class="box6-1">box横</div>
  <div class="box6-2">box横</div>
</div>

<!-- margin: 24px 56px 68px 40px; -->
<div class="outline4">
<div class="box7">margin<br>24px 56px 68px 40px</div>
  <div class="box7-1">box横</div>
  <div class="box7-2">box横</div>
</div>

.mannaka {
  display: flex;
/*   margin-left: 30px; */
}
/* margin auto */
.soto1 {
  width: 200px;
  height: 200px;
  margin: 30px;
  border: 2px solid black;
}
.box1 {
  width: 100px;
  height: 100px;
  margin: auto;
  background: #F5BCA9;
}
.box1-1 {
  width: 160px;
  height: 80px;
  background: #00ff22;
}

/* margin 0 auto */
.soto2 {
  width: 200px;
  height: 200px;
  margin: 30px;
  border: 2px solid black;
}
.box2 {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  background: #F5BCA9;
}
.box2-1 {
  width: 160px;
  height: 80px;
  background: #00ff22;
}


/* margin 0 auto 0 auto */
.soto3 {
  width: 200px;
  height: 200px;
  margin: 30px;
  border: 2px solid black;
}
.box3 {
  width: 130px;
  height: 100px;
  margin:  0 auto 0 auto;
  background: #F5BCA9;
}
.box3-1 {
  width: 160px;
  height: 80px;
  background: #00ff22;
}



/* margin 70px */
.outline {
  width: 200px;
  height: 200px;
  margin-bottom: 30px;
  border: 2px solid black;
}
.box4
{
  width: 60px;
  height: 60px;
  margin: 70px;
  background: red;
}


/* margin; 30px 40px */
.outline2 {
  display: flex;
  width: 250px;
  height: 200px;
  margin-bottom: 30px;
  border: 2px solid black;
}
.box5 {
  width: 100px;
  height: 100px;
  margin: 30px 40px;
  background: cyan;
}
.box5-1 {
  width: 60px;
  height: 60px;
  background: red;
}


/* margin: 40px 45px 50px; */
.outline3 {
  display: flex;
  flex-wrap: wrap;
  width: 350px;
  height: 300px;
  margin-bottom: 30px;
  border: 2px solid black;
}
.box6 {
  width: 160px;
  height: 100px;
  margin: 40px 45px 50px;
  background: cyan;
}
.box6-1 {
  width: 60px;
  height: 100px;
  background: red;
}
.box6-2 {
  width: 180px;
  height: 80px;
  background: pink;
}


/* margin: 24px 56px 68px 40px; */
.outline4 {
  display: flex;
  flex-wrap: wrap;
  width: 380px;
  height: 300px;
  margin-bottom: 30px;
  border: 2px solid black;
}
.box7 {
  width: 180px;
  height: 100px;
  margin: 24px 56px 68px 40px;
  background: cyan;
}
.box7-1 {
  width: 60px;
  height: 100px;
  background: blue;
}
.box7-2 {
  width: 180px;
  height: 80px;
  background: yellow;
}


.outside3 {
  margin: 20px 15px 30px;
  background: cyan;
}





.outside {
  margin: 4px 6px 8px 10px;
  background: cyan;
  width: 50%;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.