html中box带滚动条,html – 当视口调整大小时,如何强制嵌套的flexbox元素缩小并显示滚动条?...

添加这个:

#main {

min-height: 0;

flex: 1 1 0;

}

html,

body {

height: 100%;

width: 100%;

}

body {

margin: 0;

}

#root {

display: flex;

height: 100%;

}

#frame {

display: flex;

flex: 1;

flex-direction: column;

}

#navigation-bar {

background-color: #bab;

display: flex;

height: 70px;

overflow: hidden;

}

#main {

display: flex;

flex: 1 1 0;

min-height: 0;

}

#left-bar {

background-color: #aaa;

overflow: auto;

width: 250px;

}

#content {

background-color: #ccc;

flex: 1;

}

Some content

Some content

Some content

Some content

Some content

Some content

Some content

Some content

Some content

您需要min-height:0,因为如How can I get FF 33.x Flexbox behavior in FF 34.x?中所述,Flexbox模块会更改min-height的初始值:

07001

To provide a more reasonable default minimum size for 07002,

this specification introduces a new 07003 value as the initial

value of the 07004 and 07005 properties defined in

CSS 2.1.

我还添加了flex:1 1 0因为flex:1变为flex:1 1 0%,但0%在列布局中Chrome上有问题.但是0效果很好.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值