javascript - Flex transition: Stretch (or shrink) to fit content - Stack Overflow
![](https://i.stack.imgur.com/PQgJX.jpg)
I have coded a script (with the help of a user here) which allows me to expand a selected div and make the other divs behave accordingly by stretching equally to fit the remaining space (except the
Flexbox
![](https://assets-global.website-files.com/64949e4863d96e26a1da8386/65f860e0b05cfa147a3f8f07_Flexbox01-%20UI%20panel%20full%20bleed%20with%20highlight%20810px.webp)
Flexbox - Webflow University Documentation
![](https://i.stack.imgur.com/AfRI6.jpg)
html - stretching div to fit content, height dictated by image width - Stack Overflow
![](https://i.stack.imgur.com/56hYP.png)
html - justify-content and flex-grow being ignored - Stack Overflow
![](https://media.geeksforgeeks.org/wp-content/uploads/20191204123551/Screenshot-1494.png)
CSS fit-content() Property - GeeksforGeeks
![](https://i.stack.imgur.com/9HLi8.png)
html - How to stretch content to fill container while wrapping text evenly only when necessary using CSS? - Stack Overflow
![](https://i.stack.imgur.com/cHCGq.png)
css - Use flex wrap with stretch elements as rows - Stack Overflow
CSS Flexible Box Layout Module Level 1
Auntie B's Wax Happenings From The Auntie B's Wax World, 53% OFF
![](https://yqintl.alicdn.com/bbeaf20c4ba85e2101fcf245fc2b7651047edd7e.png)
Details on Flexbox Layout - Alibaba Cloud Community