Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Flexbox doesn’t center with auto margin in Firefox Re: Flexbox doesn’t center with auto margin in Firefox

#131187
dholbert
Member

If you actually want…

width: 80%;

margin: 0 auto;

…why not just use “margin :0 10%” for your centering? If you’re leaving exactly 20% of the containing-block width for use in margins, you can just assign 10% to either side and be done with it.

Here’s a fork of your codepen, with this added — it works for me in old version of Firefox: http://codepen.io/anon/pen/jLbeI

(See also https://bugzilla.mozilla.org/show_bug.cgi?id=701794 which covers the issue with auto margins and moz-box)