我試圖設置一個帶有三列的flexbox佈局,其中左列和右列具有固定寬度,並且中央列可彎曲以填充可用空間。我怎樣纔能有兩個固定寬度的柱子,中間有一個柔性柱子?
儘管爲列設置了尺寸,但隨着窗口縮小,它們似乎仍然縮小。
任何人都知道如何做到這一點?
我需要做的另一件事是根據用戶交互隱藏右列,在這種情況下,左列仍然保持其固定寬度,但中間列將填充剩餘空間。
#container {
display: flex;
justify-content: space-around;
align-items: stretch;
max-width: 1200px;
}
.column.left {
width: 230px;
}
.column.right {
width: 230px;
border-left: 1px solid #eee;
}
.column.center {
border-left: 1px solid #eee;
}
<div id="container">
<div class="column left">
<p>Anxiety was a blog series that ran in the New York Times Opinion section from January 2012 to July 2013. It featured essays, fiction, and art by a wide range of contributors that explored anxiety from scientific, literary, and artistic perspectives.</p>
</div>
<div class="column center">
<img src="http://i.imgur.com/60PVLis.png" width="100" height="100" alt="">
</div>
<div class="column right">
Balint Zsako
<br/> Someone’s Knocking at My Door
<br/> 01.12.13
</div>
</div>
這裏有一個的jsfiddle:http://jsfiddle.net/zDd2g/185/
https://jsfiddle.net/5aor2b0x/11/ – zloctb