re-describe that when a normal div wraps two div child elements of a fixed width, when the browser window shrinks, the child element "rushes out" of the parent element. When the parent element div is added with the attribute of inline-block, the child element and the parent element are adaptive, that is, the child element does not rush out of the parent element, while the parent element adapts according to the size of the browser window.
what I want to ask is the nature of this phenomenon. And the influence of inline-block here?
<div class="outter">
<div>1</div>
<div>2</div>
</div>
.outter {
background: red;
padding: 5px;
display: inline-block;
}
.outter div {
width: 800px;
margin: 5px;
background: gray;
}
this happens when the browser width is less than div,
it"s normal after the parent element is added with inline-block. Ask why, what role does inline-block play here