Reason: Using flex layout, the flex: 1 child element overflow:hidden; height: 100%; The height of the child element is stretched by the child element, causing the child element to reach the height of its grandparent. Solution: add to the child element

Min-width: 0 or min-height: 0