I have a parent div, there are two divs inside it. Div .child-long
has a width set as a percentage, and div .child-short
has a static width set in pixels.
How to make .child-long
not "shrink" .child-short
but shrinks itself?
.parent{
width: 100%;
height: 200px;
border: solid green 2px;
margin: 10px;
padding: 10px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.child-long{
height: 100%;
width: 90%;
background-color: red;
}
.child-short{
height: 100%;
width: 400px;
background-color: green;
}
<div class="parent">
<div class="child-long"></div>
<div class="child-short"></div>
</div>