数据可视化大屏之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);
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值