Created
November 5, 2024 21:19
-
-
Save tbennett/83209ad963221b556c1e09208b483129 to your computer and use it in GitHub Desktop.
A Legit Method for clearing floats. * Hack Free *
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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