1
关于how to make a child div
the height of its parent有几个问题。如何使一个div不填充其父项的高度?
我都默认这种行为,希望有相反:让孩子做不填补其母公司(十字轴)的高度:
#root {
display: flex;
flex-direction: row;
height: 50px;
width: 200px;
background: blue;
}
.el {
background: red;
}
<div id="root">
<div class="el">hello</div>
<div class="el">world</div>
</div>
我应该怎么做(对父母?对孩子?),以便hello
和world
的高度与文本紧密相关?