Skip to content

Instantly share code, notes, and snippets.

@tbennett
Created November 5, 2024 21:19
Show Gist options
  • Save tbennett/83209ad963221b556c1e09208b483129 to your computer and use it in GitHub Desktop.
Save tbennett/83209ad963221b556c1e09208b483129 to your computer and use it in GitHub Desktop.
A Legit Method for clearing floats. * Hack Free *
/* From MDN */
/*
* Clearing overlapping floats:
* To solve this problem is to use the value flow-root of the display property.
* This exists only to create a block formatting context (BFC) without using hacks —
* there will be no unintended consequences when you use it.
*/
.wrapper {
background-color: rgb(148 255 172);
padding: 10px;
color: purple;
display: flow-root;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment