I've got 5 children div
s inside a parent div
whose display is set to flex
.
I've given the children a width of 100px
each, but they are only being rendered at 1/5th of the width of the parent div
.
I've set the parent div
with overflow: scroll
in the hopes it will make the children expand to the set size, but it does now. How do I get the children div
s to be the width I give it?
.parent {
display: flex;
width: 350px;
height: 150px;
background-color: #dedede;
align-items: center;
overflow-x: hidden;
}
.child {
width: 100px;
height: 100px;
background-color: blue;
margin-left: 5px;
}
<div class="parent">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>