<分区>
我有一个 flex 容器,有两个 child (蓝色的),其中一个的高度为 600px。
因此, parent 应该已经取得了它的高度并使它的另一个 child 也具有相同的高度,因为它是在 chrome 上正确完成的。
在 Chrome v75.0.3 上
虽然,在 Safari 上,父级不会从其最大的子级 height 中得出它的高度。
在 Safari v13.0 上
下面是我用来重现问题的 temp.htm
文件。
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
}
</style>
</head>
<body style="display: flex; flex-direction: column; width: 100%; background-color: #ff0">
<div style="display: flex; flex-direction: row">
<div style="background-color: #00f; width: 75%; margin: 50px; flex-basis: content">
</div>
<div style="background-color: #00f; margin: 50px; width: 25%; height: 600px; flex-basis: content">
</div>
</div>
<div style="display: flex; flex-direction: row">
<div style="background-color: #f00; width: 75%; margin: 50px; flex-basis: content">
</div>
<div style="background-color: #f00; margin: 50px; width: 25%; height: 600px; flex-basis: content">
</div>
</div>
</body>
</html>