Flexbox 在 Safari 中仍然不稳定,flex-wrap 不起作用
Flexbox still being spotty in Safari, flex-wrap not working
我已经仔细阅读了论坛寻找这个问题的答案,但仍然没有任何效果。我在我的网站上使用 CSS3 flexbox 样式作为页脚。 HTML如下:
<footer class="footer" role="contentinfo">
<!-- copyright -->
<div id="box1" class="box">
<a class="btn" id="btn-donate" href="#">Donate</a>
<a class="btn" id="btn-news" href="#">Get News</a>
</div>
<div id="box2" class="box">
<h2>Quill Theatre</h2>
<p>P.O. Box 7265<br>
Richmond, VA 23221</p>
<p>Info@QuillTheatre.org<br>
804.340.0115</p>
<span>Social goes here</span>
</div>
<div id="box3" class="box">3</div>
<!-- /copyright -->
</footer>
我的 CSS 如下...它有点脏因为我一直在尝试一堆东西来工作:
.footer {
display: flex;
display: -webkit-flex;
-webkit-flex-direction: row;
flex-direction: row;
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
-webkit-flex-flow: row wrap;
width: 100%;
}
.footer .box {
order: 1;
min-width: 50%;
flex: 1 1 auto;
-webkit-flex: 1 1 auto;
flex-shrink: 1;
flex-basis: auto;
-webkit-flex-shrink: 1;
-webkit-flex-basis: auto;
}
.footer #box2 {
order: 0;
min-width: 100%;
flex: 2 2 auto;
-webkit-flex: 2 2 auto;
-ms-flex: 2 2 auto;
text-align: center;
border-top: 3px solid black;
border-bottom: 3px solid black;
padding-bottom: 2em;
}
.footer #box2 h2 {
text-transform: uppercase;
}
这在除 Safari 之外的所有浏览器上都可以正常工作 - 不会发生换行。我在这里缺少什么不允许包装?
仅供想知道的人:
我有太多的前缀可能会影响 Safari 的 webkit。我能够通过使用适当的 flexbox 规则(例如,使用 flex 作为 shorthand 而不是声明 flex-grow 或 flex-shrink)并使用 Autoprefixer 来处理供应商前缀来解决这个问题。
任何遇到类似问题的人。
我的带内联列表的 flex 布局在 Chrome 上运行良好,但在 Safari 上无法正常工作。
我在 li
上有一个 min-width: 25%
。
一旦我删除它,它就会在 Safari 上正确显示。
我已经仔细阅读了论坛寻找这个问题的答案,但仍然没有任何效果。我在我的网站上使用 CSS3 flexbox 样式作为页脚。 HTML如下:
<footer class="footer" role="contentinfo">
<!-- copyright -->
<div id="box1" class="box">
<a class="btn" id="btn-donate" href="#">Donate</a>
<a class="btn" id="btn-news" href="#">Get News</a>
</div>
<div id="box2" class="box">
<h2>Quill Theatre</h2>
<p>P.O. Box 7265<br>
Richmond, VA 23221</p>
<p>Info@QuillTheatre.org<br>
804.340.0115</p>
<span>Social goes here</span>
</div>
<div id="box3" class="box">3</div>
<!-- /copyright -->
</footer>
我的 CSS 如下...它有点脏因为我一直在尝试一堆东西来工作:
.footer {
display: flex;
display: -webkit-flex;
-webkit-flex-direction: row;
flex-direction: row;
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
-webkit-flex-flow: row wrap;
width: 100%;
}
.footer .box {
order: 1;
min-width: 50%;
flex: 1 1 auto;
-webkit-flex: 1 1 auto;
flex-shrink: 1;
flex-basis: auto;
-webkit-flex-shrink: 1;
-webkit-flex-basis: auto;
}
.footer #box2 {
order: 0;
min-width: 100%;
flex: 2 2 auto;
-webkit-flex: 2 2 auto;
-ms-flex: 2 2 auto;
text-align: center;
border-top: 3px solid black;
border-bottom: 3px solid black;
padding-bottom: 2em;
}
.footer #box2 h2 {
text-transform: uppercase;
}
这在除 Safari 之外的所有浏览器上都可以正常工作 - 不会发生换行。我在这里缺少什么不允许包装?
仅供想知道的人:
我有太多的前缀可能会影响 Safari 的 webkit。我能够通过使用适当的 flexbox 规则(例如,使用 flex 作为 shorthand 而不是声明 flex-grow 或 flex-shrink)并使用 Autoprefixer 来处理供应商前缀来解决这个问题。
任何遇到类似问题的人。
我的带内联列表的 flex 布局在 Chrome 上运行良好,但在 Safari 上无法正常工作。
我在 li
上有一个 min-width: 25%
。
一旦我删除它,它就会在 Safari 上正确显示。