2 回答

TA貢獻1942條經驗 獲得超3個贊
CSS Flexbox完整指南
.tiles {
? display: flex;
? flex-wrap: wrap;
? flex-direction: row;
? flex: 1;
}
.section {
? display: flex;
? flex: 1;
? flex-direction: column;
}
.item {
? display: flex;
? flex: 1;
? padding: 1rem;
? margin: 4px;
? background: green;
? color: white;
}
<div class="tiles">
? <div class="section">
? ? <div class="item">
? ? ? <p>Chromebook Helpdesk</p>
? ? </div>
? </div>
? <div class="section">
? ? <div class="item">
? ? ? <p>Sub Help</p>
? ? </div>
? ? <div class="item">
? ? ? <p>Student Tour</p>
? ? </div>
? </div>
</div>

TA貢獻1856條經驗 獲得超11個贊
如果您理解這個概念,那就很簡單了,下面是示例:
根據您的要求,您需要 2 列單行,因此您將創建
flex
屬性,現在您需要 2 列,因此您將其設置flex:50%
為 2?,F在進入您的圖像部分,您需要在下面放置 2 個圖像,因此您將提供height:50%
(右圖),你將給出height:100%
(左圖)。
您可以根據需要不斷更改尺寸。您還可以responsive
為其添加設計。希望能幫助到你。
* {
box-sizing: border-box;
}
.row {
display: flex;
}
.column {
flex: 50%;
padding: 5px;
}
<div class="row">
<div class="column">
<img src="http://i183.photobucket.com/albums/x312/Tiefnuker/office_02_zpsdz0zixcd.jpg" style="width:100%" />
</div>
<div class="column">
<div class="row">
<img src="http://i183.photobucket.com/albums/x312/Tiefnuker/office_02_zpsdz0zixcd.jpg" style="width:50%" />
</div>
<div class="row">
<img src="http://i183.photobucket.com/albums/x312/Tiefnuker/office_02_zpsdz0zixcd.jpg" style="width:50%" />
</div>
</div>
</div>
- 2 回答
- 0 關注
- 160 瀏覽
添加回答
舉報