Avoid Using overflow to Contain Floats
suggest changeValues such as overflow: hidden and overflow: auto create a block formatting context, which incidentally contains floats. Using overflow for that side effect can clip shadows or positioned content, or introduce unwanted scrollbars.
Express the intent directly:
.float-container {
display: flow-root;
}
Use Grid or Flexbox instead when the children are floated only to create columns.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents