css – Flexbox在Firefox中的按钮不起作用

显然,Firefox不喜欢显示:flex按钮。有没有办法纠正这个?

CSS:

button {
    width: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
}

    button div:first-child {
        -webkit-box-ordinal-group: 2;
        -webkit-order: 2;
        -moz-box-ordinal-group: 2;
        -ms-flex-order: 2;
        order: 2;
    }

    button div:last-child {
        -webkit-box-ordinal-group: 1;
        -webkit-order: 1;
        -moz-box-ordinal-group: 1;
        -ms-flex-order: 1;
        order: 1;
    }

HTML:

<button>
    <div>
        <p>First</p>
    </div>
    <div>
        <p>Second</p>
    </div>
</button>

现场演示:http://jsbin.com/ziwadabo/2

解决方法

tl; dr:把一个div放在你的< button>之内,并使div显示:flex。

请参阅https://bugzilla.mozilla.org/show_bug.cgi?id=984869#c2为什么显示器不会执行您期望的内容< button>在Firefox(和类似的事情,在Firefox或Webkit / Blink中不起作用的类似的东西)。

这是你修改后的jsbin:http://jsbin.com/ziwadabo/4/

相关文章

Css常用的排序方式权重分配 排序方式: 1、按类型&#160;...
原文:https://www.cnblogs.com/wenruo/p/9732704.html 先上...
css属性:word-wrap:break-word; 与 word-break:break-all 的...
https://destiny001.gitee.io/color/
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML...
css之background的cover和contain的缩放背景图 对于这两个属...