最佳答案
我试图设置一个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/