简体   繁体   English

flexbox在Firefox和Chrome中的行为不一致?

[英]non-uniform behavior of flexbox in firefox and chrome?

I tried to use flexbox for the navigation bar as shown in the jsfiddle link below 我尝试将flexbox用于导航栏,如下面的jsfiddle链接所示

http://jsfiddle.net/qq9pn/5/ http://jsfiddle.net/qq9pn/5/

it works like a charm under firefox -- as illustrated by the jsfiddle page, but in chrome the first icon sits at the center of the nav bar but the second icon is kicked out of the nav bar. 它像在Firefox下的魅力一样工作-如jsfiddle页面所示,但在chrome中,第一个图标位于导航栏的中心,但是第二个图标从导航栏踢出。

I'm aware that 我知道

-webkit-box-flex:1.0; /* Chrome */

and

-moz-box-flex:1.0; /* Firefox */

behaves different in the two browsers, but how can I enforce exactly the same behavior of flexbox in the two? 两种浏览器的行为不同,但是如何在两种浏览器中强制执行完全相同的行为?

You're not using actual CSS flexbox in either Firefox or Chrome in that testcase. 在该测试用例中,您没有在Firefox或Chrome中使用实际的CSS flexbox。 You're using XUL boxes in Firefox, and a very old and buggy "flexbox" draft in Chrome. 您在Firefox中使用的是XUL框,而在Chrome中使用的是一个非常古老且有错误的“ flexbox”草稿。 They have totally different behavior from each other and from the current flexbox draft at http://dev.w3.org/csswg/css-flexbox/ 它们的行为和当前的flexbox草案( http://dev.w3.org/csswg/css-flexbox/)完全不同。

I recommend not using -moz-box or -webkit-box, because they're basically very broken and will be removed, not fixed. 我建议不要使用-moz-box或-webkit-box,因为它们基本上已经损坏,将被删除,而不是固定的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM