I used to chase float bugs by adding clearfix divs, now I just open devtools and see the 3px gap on the card grid myself | CSS Shenanigans - The Design Community Hub
I used to chase float bugs by adding clearfix divs, now I just open devtools and see the 3px gap on the card grid myself
Spent a Tuesday in March hunting why my pricing cards sat uneven, and my old habit of dropping `clear: both` divs everywhere only hid the mess. Opening the inspector and spotting the 3px extra from a stray line-height on the wrapper fixed it in two minutes. Anyone else still tempted to reach for a clearfix out of muscle memory?
Muscle memory is real, I still catch myself typing a clearfix out of habit before my brain catches up. Best trick I've found is to check the computed box on the wrapper first, since line-height and inline-block spacing cause way more of these gaps than actual float issues. If the 3px only shows up between cards, try setting the grid to flex or grid instead of floats, and the phantom gap goes away for good. Floats were never meant to lay out cards, they just happened to work for a while back in the day.