2
I made the following example code:
.container {
width: 200px;
height: 50px;
background-color: #f00;
display: flex;
flex-direction: row;
overflow-x: scroll;
}
.div1 {
width: 150px;
background-color: #0f0;
}
.div2 {
width: 150px;
background-color: #00f;
}
<div class="container">
<div class="div1">150px</div>
<div class="div2">150px</div>
</div>
Note that I have a div "container" with 200px wide and inside two other Divs with 150px wide and need to have a scroll bar in the container div. It turns out that even setting the width of 150px to "div1" and "div2", the Divs "shrunk" to fit in 200px as per the image:
How to stop it from happening?
I kept testing and managed to solve using flex-Shrink: 0; in the child elements, but thank you for the suggestion too!
– Mario Fabre