In this jsfiddle http://jsfiddle.net/54rp7x29/ I've set a flexbox to contain some fixed-width items. But the outer container
element is wider than the items inside it. How can I set it to be no bigger than it needs to be? And to always be no bigger than it needs to be when the screen is resized (which will cause more or less flexbox items to be in the same row)?
This is the html:
<div id="container">
<div id="content"></div>
<div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
This is the css:
html {
max-width: 60%;
}
#content {
background-color: green;
height: 20px;
}
#container {
background-color: yellow;
}
#container>div {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
#container>div>div {
width: 80px;
height: 100px;
background-color: gray;
margin: 3px;
}