【发布时间】:2023-03-14 18:43:01
【问题描述】:
由于某种原因,我在 Firefox 22 中处理的项目无法正确显示。在 webkit 浏览器中运行良好(在 Opera 15 和 Chrome 27 中测试;Safari 直到 7.0 才支持更新的规范)。一切都只是按行分组在一起,所以我的第一个想法是将 flex-direction 更改为列而不是行,但这甚至没有帮助。
* {
margin:0;
padding:0;
}
body {
background: none repeat scroll 0% 0% #ECF1E1;
color: #FFFFFF;
font-size: 100%;
height: 100%;
display: flex;
display: -webkit-flex;
width:100%;
flex-flow: row wrap;
-webkit-flex-flow: row wrap;
overflow-x:hidden;
}
#content {
background: linear-gradient(to bottom, rgb(54,156,245) 0%, rgb(16,91,161) 52%);
background: -webkit-linear-gradient(to bottom, rgb(54,156,245) 0%, rgb(16,91,161) 52%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#105BA1', endColorstr='#369CF5',GradientType=0 ); /* IE6-9 */
border-radius: 5px 5px 5px 5px;
border: 5px outset #FF6600;
margin: 0% .25%;
-webkit-flex:2;
flex: 2;
padding:0% 1.3%;
}
#login {
background: linear-gradient(to bottom, rgb(54,156,245) 0%, rgb(16,91,161) 52%);
background: -webkit-linear-gradient(to bottom, rgb(54,156,245) 0%, rgb(16,91,161) 52%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#105BA1', endColorstr='#369CF5',GradientType=0 ); /* IE6-9 */
border-radius: 5px;
border: 5px outset #FF6600;
flex:1;
-webkit-flex:1;
padding:10px;
margin: 0% .25%;
}
footer#footer {
background: linear-gradient(to bottom, rgb(54,156,245) 0%, rgb(16,91,161) 52%);
background: -webkit-linear-gradient(to bottom, rgb(54,156,245) 0%, rgb(16,91,161) 52%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#105BA1', endColorstr='#369CF5',GradientType=0 ); /* IE6-9 */
border-top: 5px outset #FF6600;
height: 50px;
padding: 0% 1%;
text-align:center;
clear:both;
width:100%;
margin: 2% 0% 0% 0%;
}
它应该是 2 列布局(无论如何在台式机上),但就像我说的那样,所有内容都在 Firefox 22 的页面顶部连续聚集在一起。
【问题讨论】:
-
根据caniuse,所有最新版本的FF都不支持
flex-flow属性 -
只是弹性流?是否也包括 flex-direction 和 wrap?
-
我忘了提到
flex-wrap属性也不支持。 Firefox 正在实现旧版本的 Flexbox 模块。 -
真的吗?更改日志显示,新规范自 20 版起就受到支持(尽管在 22 版之前处于标记状态)。
-
Firefox 支持 flex-flow 和 flex-wrap 属性,它不支持启用包装的值。
flex-flow: row nowrap或flex-wrap: nowrap工作,但不是flex-flow: row wrap或flex-wrap: wrap。为什么他们选择继续他们不完整的实施,我无法理解。