<分区>
<分区>
我遇到了一个问题,在 safari 中,ul 元素没有显示在其父元素的 100% 高度处。我知道这不是一个新问题,之前可能已经在这里得到解答,但我找不到接近我的具体问题的答案,其中大部分是关于 div 不是整个页面的 100% 等。
这是它在 Chrome 中的样子(这是我想要的结果):
这是它在 Safari 中的样子:
这是CSS:
.container {
display: flex;
flex-flow: row wrap;
}
.header {
min-height: 60px;
border: 1px solid #000;
}
.list {
height: 100%;
display: flex;
justify-content: flex-start;
list-style: none;
margin: 0;
padding: 0;
}
li {
padding: 10px;
background-color: #cecece;
}
请注意,我的应用程序需要 .list
类中的其余 css。
请查看 Jsfiddle
干杯!
最佳答案
.container {
display: flex;
flex-flow: row wrap;
}
.header {
min-height: 60px;
border: 1px solid #000;
}
.list {
height: 100%;
display: flex;
justify-content: flex-start;
list-style: none;
margin: 0;
padding: 0;
background-color: #cecece;
}
li {
padding: 10px;
background-color: #cecece;
}
<div class="container">
<div class="header">
<ul class="list">
<li>
Donald
</li>
<li>
Hillary
</li>
<li>
Gary
</li>
</ul>
</div>
</div>
关于css - 列表高度 100% 在 Safari 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39582013/