<div>
<div class="box01">
箱
</div>
<div class="box02">
<div class="box-child">小さい箱</div>
</div>
</div>
div{
text-align: center;
}
.box01,.box02{
width: 150px;
}
.box01{
background-color: lightblue;
}
.box02{
margin-top: 10px;
background-color: lightyellow;
}
.box-child{
background-color: pink;
margin-top: 50px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.