【发布时间】:2014-07-10 18:37:24
【问题描述】:
我正在尝试设置具有三列的 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/
【问题讨论】: