方法一:
css样式和html代码如下:
<div class="parent1">
<div class="child">1</div>
<div class="child">2</div>
</div>
<div class="parent2">
<div class="child">3</div>
<div class="child">4</div>
</div>
body,html{
margin: 0;
padding: 0;
height: 100%;
}
.parent1{
display: flex;
height: 50%;
justify-content: space-between;
background-color: gray;
}
.parent2{
display: flex;
height: 50%;
align-items: flex-end;
justify-content: space-between;
}
.child{
width: 100px;
height: 100px;
backgro