Consider the following HTML and CSS:
<div class="container">
<span>This text appears inside a span tag which is an inline element.</span>
<p>This text appears inside a paragraph tag which is a block element.</p>
<span>This is another inline element.</span>
</div>
.container {
overflow: hidden;
}
Based on my understanding from the following SO question, by adding overflow: hidden
to the .container
class will establish the div
as a new Block Formatting Context.
Question
How does this affect the span
and p
tags inside of the div
? Specifically, what does creating a new block formatting context actually do to its children elements (in this case, inline span
elements and a block p
element)?
Related Question
What is an example of an Inline Formatting Context getting created? Can someone provide a HTML example and explain how it is established? What does the inline formatting context actually do to its children elements?