
数据可视化大屏之display布局
可视化大屏布局
·
前提问题:实现可视化大屏的布局
解决过程:使用了display布局,完成了以上布局要求
解决结果:
html:
<div class="moduleShow">
<!-- 头部区域 -->
<div class="headerModule"></div>
<div class="mainModule">
<!-- 左侧区域 -->
<div class="leftModule">
<div class="leftMTop"></div>
<div class="leftMBottom"></div>
</div>
<!-- 中间区域 -->
<div class="centerModule">
<div class="centerMTop"></div>
<div class="centerMCenter"></div>
<div class="centerMBottom">
<div class="centerMBL"></div>
<div class="centerMBR"></div>
</div>
</div>
<!-- 右侧区域 -->
<div class="rightModule">
<div class="rightMTop"></div>
<div class="rightMCenter"></div>
<div class="rightMBottom"></div>
</div>
</div>
</div>
css:
.moduleShow {
height: 100%;
width: 100%;
background: #fff;
display: flex;
flex-direction: column;
}
.headerModule{
height: 9%;
width: 100%;
border: 1px solid red;
margin-bottom: 10px;
}
.mainModule{
height: 90%;
width: 100%;
background: #fff;
display: flex;
margin: 0 auto;
.leftModule{flex: 2.2;}
.centerModule{flex: 5.6;}
.rightModule{flex: 2.2;}
}
.leftModule{
display: flex;
flex-direction: column;
.leftMTop{
height: 49%;
width: 100%;
border: 1px solid red;
margin-bottom: 5px;
}
.leftMBottom{
height: 49%;
width: 100%;
border: 1px solid green;
margin-top: 5px;
}
}
.centerModule{
display: flex;
flex-direction: column;
justify-content: space-between;
.centerMTop{
height: 15%;
width: 98%;
border: 1px solid red;
margin: 0 auto;
}
.centerMBottom{
height: 33%;
width: 100%;
// border: 1px solid red;
display: flex;
align-items: center;
.centerMBL{
width: 48%;
height: 100%;
border: 1px solid #000;
margin: 10px 5px 0 10px;
}
.centerMBR{
width: 50%;
height: 100%;
border: 1px solid rgb(4, 0, 255);
margin: 10px 10px 0 5px;
}
}
}
.rightModule{
display: flex;
flex-direction: column;
// justify-content: space-between;
.rightMTop{
height: 33%;
width: 100%;
border: 1px solid rgb(255, 0, 191);
}
.rightMCenter{
height: 33%;
width: 100%;
border: 1px solid rgb(255, 77, 0);
margin: 10px 0;
}
.rightMBottom{
height: 33%;
width: 100%;
border: 1px solid rgb(0, 255, 55);
}
}
更多推荐
所有评论(0)