我有一些嵌套的 Flexbox 布局,它们在 Chrome 和 Safari 11+ 中完美工作,但在 Safari 10.1.2 中行为不正确
在 Chrome 中 - 它看起来符合预期:
然而在 Safari 10.1.2 中:
有人可以帮我弄清楚如何修复吗?谢谢!
这是我的(稍微简化的)HTML:
<div class="content-canvas">
<div class="horizontal-section" id="blog">
<h1>Blog</h1>
<div id="divRss">
<ul class="feedEkList">
<li>
<div class="itemTitle"><a href="#</a></div>
<div class="itemDate">10/16/2017</div>
<div class="itemContent">Some text</div>
</li>
<li>
As above
</li>
</ul>
</div>
<a href="##" target="_blank">Read more</a>
</div>
<div class="horizontal-section" id="upcoming">
...
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
还有我的CSS:
.content-canvas {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-grow: 2;
-moz-flex-grow: 2;
-ms-flex-grow: 2;
-o-flex-grow: 2;
flex-grow: 2;
}
#blog,
{
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
-o-flex-direction: column;
flex-direction: column;
-webkit-justify-content: space-between;
-moz-justify-content: space-between;
-ms-justify-content: space-between;
-o-justify-content: space-between;
justify-content: space-between;
}
#divRss,
{
padding: 10px;
height: 0;
-webkit-flex-grow: 2;
-moz-flex-grow: 2;
-ms-flex-grow: 2;
-o-flex-grow: 2;
flex-grow: 2;
}
.feedEkList,
{
width: 100%;
height: 100%;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
-o-flex-direction: column;
flex-direction: column;
-webkit-justify-content: space-around;
-moz-justify-content: space-around;
-ms-justify-content: space-around;
-o-justify-content: space-around;
justify-content: space-around;
}
.feedEkList li,
{
height: 0;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-grow: 1;
-o-flex-grow: 1;
flex-grow: 1;
}
Run Code Online (Sandbox Code Playgroud)
我个人在 Safari 上遇到了一个问题,当我的上部 Flexbox 的内容超过其高度的 100% 时,在这种情况下,嵌套 Flexbox 的高度缩小到 1px。
flexbox-shrink: 0我通过设置嵌套弹性盒来修复它。
| 归档时间: |
|
| 查看次数: |
1422 次 |
| 最近记录: |