BootStrap佈局結構 Flex各種佈局

1、左右結構
在這裏插入圖片描述

<div class="d-flex flex-row" style="width: 500px; height: 400px;border:2px solid #ae00e6">
    <div region="west" class="west" style="width: 140px;">
        西
    </div>
    <div region="center" class="center flex-fill"></div>
</div>

在這裏插入圖片描述

<div class="d-flex flex-row" style="width: 500px; height: 400px;border:2px solid #ae00e6">
    <div region="center" class="center flex-fill"></div>
    <div region="east" class="east" style="width: 140px;"></div>
</div>

2、上下結構

在這裏插入圖片描述

<div class="d-flex flex-column" style="width: 500px; height: 400px;border:2px solid #ae00e6">
    <div region="north" class="north" style="height: 80px;"></div>
    <div region="center" class="center flex-fill"></div>
</div>

在這裏插入圖片描述

<div class="d-flex flex-column" style="width: 500px; height: 400px;border:2px solid #ae00e6">
    <div region="center" class="center flex-fill"></div>
    <div region="south" class="south" style="height: 80px;"></div>
</div>

3、上中下
在這裏插入圖片描述

<div class="d-flex flex-column" style=" height: 400px;border:2px solid #ae00e6">
    <div region="north" class="north" style="height: 80px;"></div>
    <div region="center" class="center flex-fill"></div>
    <div region="south" class="south" style="height: 80px;"></div>
</div>

4、左中右
在這裏插入圖片描述

<div class="d-flex flex-row" style=" height: 400px;border:2px solid #ae00e6">
    <div region="west" class="west" style="width: 140px;">
        西
    </div>
    <div region="center" class="center flex-fill"></div>
    <div region="east" class="east" style="width: 140px;"></div>
</div>

5、組合嵌套

在這裏插入圖片描述

<div class="d-flex flex-row" style="width: 500px; height: 400px;border:2px solid #ae00e6">
    <div region="west" class="west" style="width: 140px;">
        西
    </div>
    <div region="center" class="center flex-fill">
        <div class="d-flex flex-column flex-fill" style="border:1px solid blue;height: 100%;">
            <div region="north" class="north" style="height: 80px;"></div>
            <div region="center" class="center flex-fill"></div>
        </div>
    </div>
</div>

在這裏插入圖片描述

<div class="d-flex flex-row" style="width: 500px; height: 400px;border:2px solid #ae00e6">
    <div region="center" class="center flex-fill">
        <div class="d-flex flex-column flex-fill" style="border:1px solid blue;height: 100%;">
            <div region="center" class="center flex-fill"></div>
            <div region="south" class="south" style="height: 80px;"></div>
        </div>
    </div>
    <div region="east" class="east" style="width: 140px;"></div>
</div>

在這裏插入圖片描述

<div class="d-flex flex-row" style="width: 500px; height: 400px;border:2px solid #ae00e6">
    <div region="center" class="center flex-fill">
        <div class="d-flex flex-column flex-fill" style="border:1px solid blue;height: 100%;">
            <div region="north" class="north" style="height: 80px;"></div>
            <div region="center" class="center flex-fill"></div>
            <div region="south" class="south" style="height: 80px;"></div>
        </div>
    </div>
    <div region="east" class="east" style="width: 140px;"></div>
</div>

在這裏插入圖片描述

<div class="d-flex flex-row" style="width: 500px; height: 400px;border:2px solid #ae00e6">
    <div region="west" class="west" style="width: 140px;">
        西
    </div>
    <div region="center" class="center flex-fill">
        <div class="d-flex flex-column flex-fill" style="border:1px solid blue;height: 100%;">
            <div region="north" class="north" style="height: 80px;"></div>
            <div region="center" class="center flex-fill"></div>
            <div region="south" class="south" style="height: 80px;"></div>
        </div>
    </div>
</div>

在這裏插入圖片描述

<div class="d-flex flex-column" style=" height: 400px;border:2px solid #ae00e6">
    <div region="north" class="north" style="height: 80px;"></div>
    <div region="center" class="center flex-fill d-flex flex-column">
        <div class="d-flex flex-row flex-fill" style=" height: 100%;border:1px solid blue">
            <div region="west" class="west" style="width: 140px;">
                西
            </div>
            <div region="center" class="center flex-fill"></div>
            <div region="east" class="east" style="width: 140px;"></div>
        </div>
    </div>
    <div region="south" class="south" style="height: 80px;"></div>
</div>

在這裏插入圖片描述

<div class="d-flex flex-column" style=" height: 400px;border:2px solid #ae00e6">
    <div region="center" class="center flex-fill d-flex flex-column">
        <div class="d-flex flex-row flex-fill" style=" height: 100%;border:1px solid blue">
            <div region="west" class="west" style="width: 140px;">
                西
            </div>
            <div region="center" class="center flex-fill"></div>
            <div region="east" class="east" style="width: 140px;"></div>
        </div>
    </div>
    <div region="south" class="south" style="height: 80px;"></div>
</div>

在這裏插入圖片描述

<div class="d-flex flex-column" style=" height: 400px;border:2px solid #ae00e6">
    <div region="north" class="north" style="height: 80px;"></div>
    <div region="center" class="center flex-fill d-flex flex-column">
        <div class="d-flex flex-row flex-fill" style=" height: 100%;border:1px solid blue">
            <div region="west" class="west" style="width: 140px;">
                西
            </div>
            <div region="center" class="center flex-fill"></div>
            <div region="east" class="east" style="width: 140px;"></div>
        </div>
    </div>
</div>

在這裏插入圖片描述

<div class="d-flex flex-column" style=" height: 400px;border:2px solid #ae00e6">
    <div region="north" class="north" style="height: 80px;"></div>
    <div region="center" class="center flex-fill d-flex flex-column">
        <div class="d-flex flex-row flex-fill" style=" height: 100%;border:1px solid blue">
            <div region="center" class="center flex-fill"></div>
            <div region="east" class="east" style="width: 140px;"></div>
        </div>
    </div>
    <div region="south" class="south" style="height: 80px;"></div>
</div>

原文鏈接:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章