统计页面左右+上下自适应布局

该代码示例展示了如何使用CSSFlexbox创建一个三栏布局,包括左侧20%、中间60%和右侧20%的区域。每个栏都有可调整高度的子项,适用于网页设计中的响应式布局。通过修改百分比,可以轻松调整各栏的宽度。
摘要由CSDN通过智能技术生成

1:如果需要调整分栏数量,那么只需要删除对应数据,修改百分比即可.

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css" lang="less" >
			body{
				margin: 0px ;
			}
			.box_parent{
				min-width: 1000px ;
				min-height: 600px;

				width: 100%;				
				height: calc(100vh - 0px);

				.box{
					top: 0px;
					left: 0px;
					right: 0px;
					bottom: 0px;
					letter-spacing:0px;
					background-color: #9e9e9e38;
					height: 100%;
					width: 100%;
					display: flex;
					box-sizing: border-box;
					padding: 7px;
					
					.box_left{
						height: calc(100%  );
						display: flex;
						flex-direction:column;
						width: 20%;
					}
					.box_center{
						height: calc(100%);
						display: flex;
						flex-direction:column;
						width: 60%;
					}
					.box_right{
						height: calc(100%);
						display: flex;
						flex-direction:column;
						width: 20%;
					}
					
					.item_box{
							height: calc(25%);
							margin: 7px;
							

							box-sizing: border-box;
							border-radius: 5px;
							background-color: #ffffff;
							padding: 10px;
							
							
						
							.box_content{
								box-sizing: border-box;
								height: 100%;	
								display: block;
								background-color: aliceblue;
								overflow: auto;
							}
					}
					.item_box_70{
							height: calc(65%);
					}
					.item_box_30{
							height: calc(35% );
					}
				}
			}
			
			
			
	  </style>
	</head>
	<body>
		
		<div class="box_parent">
			<div class="box">
				<div class="box_left">
					<div class="item_box" >
						<div class="box_content">
							111
						</div> 
					</div>
					<div class="item_box" >
						<div class="box_content">
							11111
						</div> 
					</div>
					<div class="item_box"  >
						<div class="box_content">
							11111
						</div> 
					</div>
					<div class="item_box"  >
						<div class="box_content">
							11111
						</div> 
					</div>
				</div>
				
				<div class="box_center" >
						<div class="item_box item_box_70">
							<div class="box_content">
								11111
							</div> 
						</div>
						
						<div class="item_box item_box_30">
							<div class="box_content">
								11111
							</div> 
						</div>
					
				</div>
				
				<div class="box_right" ">
					<div class="item_box" >
						<div class="box_content">
							11111
						</div> 
					</div>
					<div class="item_box" >
						<div class="box_content">
							11111
						</div> 
					</div>
					<div class="item_box"  >
						<div class="box_content">
							11111
						</div> 
					</div>
					<div class="item_box"  >
						<div class="box_content">
							11111
						</div> 
					</div>
				</div>
			</div>
		</div>
			
	</body>
</html>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值