在我的基于flexbox的布局中,我可能有一个<pre><code></code></pre>元素(以及其他元素).因为它的内容可能比容器更宽,所以我做到了overflow-x:auto.
它在Chrome上完美运行:

但它在Firefox上被破坏了:

如何在没有硬编码尺寸的情况下解决这个问题?
div,pre {
padding: 5px;
color: white;
}
.m {
background: #222;
display: flex;
}
.l, .r {
background: #143;
flex: 0 0 100px;
}
.c {
background: #971;
flex: 1;
}
pre {
white-space: pre;
word-wrap: normal;
overflow-x: auto;
}Run Code Online (Sandbox Code Playgroud)
<div class=m>
<div class=l>this must be 100px wide</div>
<div class=c>this must take the remaining space</div>
<div class=r>this must be 100px wide</div>
</div>
<div class=m>
<div class=l>this must be 100px wide</div>
<div class=c> …Run Code Online (Sandbox Code Playgroud)