26
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?
2 comments
Log in to join the discussion
Log In2 Comments
joseph_green138d ago
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.
4
sanchez.julia8d ago
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.
2