I want the container div (#a
in this example) to fit the width
of its children, that are inline-block
divs.
The number of div
s per row is unknown, because it depends on the size of the screen.
On the example, what I would like is that there is no extra gray space at the right of the #a container.
Is it possible? (pure CSS please)
#a {
background-color: gray;
}
.b {
width: 110px;
height: 110px;
display: inline-block;
background-color: blue;
}
<div id="a">
<div class="b"></div>
<div class="b"></div>
<div class="b"></div>
<div class="b"></div>
<div class="b"></div>
<div class="b"></div>
<div class="b"></div>
<div class="b"></div>
<div class="b"></div>
</div>