div上、中、下布局,鼠标移入移出显示滚动条

<div className={styles.container_box}>
	<div style={{background:'green'}} className={styles.head_box}></div>
	<div className={styles.main_box}>
		 <div className={styles.main_container}>
            <div style={{background:'coral'}}></div>
            <div style={{background:'lightblue'}}></div>
            <div style={{background:'khaki'}}></div>
            <div style={{background:'pink'}}></div>
          </div>
	</div>
	<div style={{background:'blue'}} className={styles.footer_box}></div>
</div>

.container_box{
	height:100%;
	width:100%;
	display:flex;
	flex-direction:column;
	position:absolute;
	top:0;
	left:0;
}

.head_box{
	height:60px;
	width:100%;
	border-bottom:10px solid #eff3f5;
}

.main_box{
	flex:1;
	width:100%;
	height:0;
	overflow:hidden;
	padding-right:5px;
	&:hover{
		overflow:auto;
		padding-right:0px;
        padding-bottom:0px;
	}
    /*定义滚动条宽高及背景,宽高分别对应横竖滚动条的尺寸*/
	&::-webkit-scrollbar{
		width:5px !important;
        height: 10px !important;
        //background-color: rgba(245, 245, 245, 0.47);
	}
    /*定义滑块,内阴影及圆角*/
	&::-webkit-scrollbar-thumb{
		border-radius:20px !important;
		-webkit-box-shadow:inset 0 0 3px rgba(0,0,0,0.3) !important;
		background:#f0f0f0 !important;
	}
    /*定义滚动条的轨道,内阴影及圆角*/
	&::-webkit-scrollbar-track{
		border-radius:20px !important;
		//-webkit-box-shadow:inset 0 0 5px #f0f0f0 !important;
		background:transparent !important;
	}
}

.main_container{
    width: 100%;
    height: 100%;
    // border: 1px solid #c3c3c3;
    // display: -webkit-flex; /* Safari */
    // -webkit-justify-content: space-around; /* Safari 6.1+ */
    display: flex;
    justify-content: space-around;
    align-items: center;
    div {
        width: 100%;
        height: 100%;
    }
}

.footer_box{
	width:100%;
	height:60px;
	border-top: 1px solid #e5e5e5;
	display:flex;
	align-items:center;
	box-sizing:border-box;
}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值