flex布局尝试

一个新项目,拿的element-ui-admin做的模板

因为项目需求两级导航菜单,不得已需要对页面布局重构

尝试了flex布局,完美解决

效果大概如下,flex套了好几层,但是好用呀

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>flex布局</title> 
<style> 
.div0
{
	display:flex;
	flex-direction:column;
	background: #ccc;
	height: 400px;	
	overflow: auto;
}
.div-top{
	flex:0 0 auto;
	background: #ddd;
	height: 60px;
}
.div-bottom{
	flex:1 1 auto;
	background: #eee;
	display:flex;
	flex-direction:row;
	overflow: auto;
}
.div-left{
	flex:0 0 auto;
	background: #aaa;
	width:120px;
}
.div-right{
	flex:1 1 auto;
	background: #eee;
	display:flex;
	flex-direction:column;
}
.div-tag{
	flex: 0 0 auto;
	background: #cfcfcf;
}
.div-show{
	flex: 1 1 auto;
	overflow: auto;
	
}
</style>
</head>
<body>

<div class="div0">
	<div class="div-top">一级导航</div>
	<div class="div-bottom">
		<div class="div-left">二级导航</div>
		<div class="div-right">
			<div class="div-tag">标签栏</div>
			<div class="div-show">
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
				页面区域<br>
			</div>
		</div>
	</div>
</div>
</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值