css children in the same parent should set different heights align-items:baseline; align-self:baseline;

Problem:
The outer layer is fatherinside 2 isson

Now inside the two sonshould not be the same height, it should be out differently!
Insert picture description here
Just like this picture , to achieve this效果
Insert picture description here

the first method:

<div class="father">
	<div class="left-son">Left Son</div>
	<div class="right-son">Right Son</div>
</div>
.father{
    
    
	width:1280px;
	display:flex;
	justify-content:center;
	align-items:baseline; // `重点是这部分`
}

The second method:

<div class="father">
	<div class="left-son">Left Son</div>
	<div class="right-son">Right Son</div>
</div>
.father{
    
    
	width:1280px;
	display:flex;
	justify-content:center;
}
.left-son{
    
    
	align-self:baseline;
}

Guess you like

Origin blog.csdn.net/weixin_43814775/article/details/113523945