Search
Star
Feedback
Setup for Free
ยฉ 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
How is the size of nested flexboxes computed? - Kevin Powell - Community
KP-C
Kevin Powell - Community
โข
2mo ago
โข
4 replies
root
How is the size of nested flexboxes computed?
๐
ui/ux
front-end
When a flexbox is in another flexbox
, do the effects of
flex-shrink
flex-shrink
get computed for the
inner or outer flexbox first
?
During that computation
, what size is assumed for the parent or child whose shrink computations didn
't happen yet
?
Here
's an example where
.a
.a
and
.c
.c
start at
700px
700px
and have
flex-shrink: 1
flex-shrink: 1
but all elements end up with different sizes for some reason
:
https://jsfiddle.net/5ugbxe8y/1/
Nested flexbox shrinking - JSFiddle - Code Playground
JSFiddle
- Test your JavaScript
, CSS
, HTML or CoffeeScript online with JSFiddle
.
Kevin Powell - Community
Join
A friendly place for developers to meet other devs, ask questions, get help, and just have a good time ๐.
36,263
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
My nested flexboxes aren't working :((
KP-C
Kevin Powell - Community / help
3mo ago
Help me figure the container size.
KP-C
Kevin Powell - Community / help
10mo ago
background size
KP-C
Kevin Powell - Community / help
3w ago
Nested `:has()` alternative
KP-C
Kevin Powell - Community / help
7mo ago