我有两个div:
这是我想要的行为,但是在FireFox 中不起作用,它只是停止调整其宽度而开始在恒定大小div上移动。< / p>
小提琴示例:https://jsfiddle.net/qxda20g9/
<style>
.noadjust {
width:330px;
height:40px;
float:right;
background-color:teal;
color:white;
}
.automagic {
min-width: 160px;
overflow: hidden;
width: auto;
padding: 5px;
min-height: 30px;
background-color:lightblue;
}
</style>
<div class="noadjust">constant size</div>
<div class="automagic">fills line or drops to next</div>
答案 0 :(得分:0)
我不确定原因,但如果容器div有边框顶部或填充顶部,它可以解决问题:pull request
<div id="contain" style="padding-top:1px;">
如果有人愿意解释,我们会很乐意知道它的原因。
答案 1 :(得分:0)
这应该做的工作:
@media (max-width: 161px) {
.automagic { display: block; width: 100%; clear: both; }
}