It's entirely possible, and even necessary for certain CSS rules. The easiest way to understand this is with an example of such a box.
<div style="overflow:auto">hello world</div>
Here we have an element with display:block
(by default for div elements) and overflow:auto
. This is one way that an element's rendered box will establish a block formatting context. This affects, for example, how the box's location and dimensions are affected by the presence of floats.
Compare these two examples:
.formatting.contexts {
overflow:visible;
}
.container {
width:70px;
}
img {
float:left;
margin-right:3px;
}
<div class="container">
<img src="http://placehold.it/16" alt="placeholder grey square less than one line in height">
<div class="formatting contexts">hello world</div>
</div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…