My overflow: hidden
container doesn't contain the adjacent floated element (orange box) inside of itself.
The floated element goes beside the container (section). But when I remove overflow:hidden
, the adjacent floated element will go inside the container and respect the container's floated children.
Why is this happening? Does it have anything to do with block formatting context?
Maybe when I apply overflow: hidden;
for the container, it triggers a new BFC and will only contain its children and no adjacent floated elements?
Here is a fiddle