float aligns an element to the left/right edge; adjacent text and inline content wraps around it.clear, and fix container height via overflow:auto, display: flow-root, or clearfix.float doesleft, right, none.Mini example:
.img { float: left; margin: 0 8px 8px 0; }clearclear: left|right|both — prevents wrapping from specified sides.Mini example:
.block { clear: both; }Fix options:
.container { overflow: auto; }
/* or */
.container { display: flow-root; }clearfix via pseudo‑elementClassic way to close the flow:
.container::after {
content: "";
display: block;
clear: both;
}clear — content overlaps floats.display: flex and display: grid for layout.float for small, local tasks (image wrapping, similar cases).