Home >Web Front-end >CSS Tutorial >Why Does My Outer Div Collapse When Resizing the Browser Window?
Why Doesn't the Outer In a container with an inner and outer Block elements typically take up as much width as their parent container. When the window is resized to a narrower width, the outer To address this issue, a combination of inline-block and min-width: 100% can be used. inline-block allows an element to behave both as an inline and block element. By setting min-width:100%, the outer Updated Code By adding display: inline-block and min-width: 100% to the outer The above is the detailed content of Why Does My Outer Div Collapse When Resizing the Browser Window?. For more information, please follow other related articles on the PHP Chinese website!.demo {
display: inline-block;
min-width: 100%;
}