TIL resetting my CSS fixed a layout I'd been fighting for 3 days | Coding For Beginners - Freelance Forum - The Community for Independent Professionals
TIL resetting my CSS fixed a layout I'd been fighting for 3 days
I was building a simple portfolio page for like a week straight. Every time I added a new section, the whole thing would just break. Finally my buddy Mike came over and was like "did you set a box-sizing border-box?" I had no idea that was a thing. Turns out my padding was making everything spill out of the container. Has anyone else spent way too long on something this basic?
Oh man, "padding was making everything spill out" - that is the most relatable web dev pain. I've definitely lost a whole afternoon to the box-sizing thing myself.
3 days on box-sizing is rough but @joseph_green13 I actually think the real culprit was not using a CSS reset from the start. Browsers ship with default margins and padding that add up fast, and border-box alone won't save you from those. A simple reset like Meyer's clears all that junk out before you even start.