I'm new to flexbox, but I'm assuming it's the best tool for what I'm trying to do. (If not, I'm open to other ideas.) I have a set of features of a "product" - something like this:
<div class="flexbox-container">
<div class="borderbox flexbox">A paragraph of content about the first feature...</div>
<div class="borderbox flexbox">Another paragraph of content about the second feature...</div>
<div class="borderbox flexbox">The third feature...</div>
</div>
...with 12 boxes in all. See http://codepen.io/OsakaWebbie/pen/kkyYOp to see my real content with a klugey way of getting something close to what I want. What I really want is to define a common height for the boxes and then let flexbox adjust the widths based on the content (minimizing dead space after shorter paragraphs), but I can't figure out how. flex-basis:auto
sounds relevant, but it didn't have any effect on the layout. I tried this CSS:
.flexbox {
height: 8em;
min-width: 8em;
max-width: 20em;
}
But it ignored the min-width
and made everything the max. Currently I'm having to tweak the markup and specify a width (or a class equating to a width) for each box based on its content, but I'm hoping to get the power of flexbox to do that automatically. Is it possible?