How do people degug overflowing elements that overflow other elements?

I have an overflowing element but can't narrow down the culprit, does anyone have a method they use to identify which element is actually overflowing everything
No description
4 Replies
Zach
ZachOP•16h ago
I'm using outline to see visually the overflowing boxes but hitting a wall with identifying what is causing overflow
~MARSMAN~
~MARSMAN~•15h ago
If I would take a wild guess in this case... The first suspect for me would be the image. If you're setting a width of 100% to the image, then check if its parent has a set width, and then the parent's parent, and so on till you reach the parent that doesn't have a width. Because for me it looks like the image is taking the body size, the outermost red border ( excluding the image's parent ), since it can't take an ancestor's width.
Zach
ZachOP•15h ago
ah right, yea I should thoroughly follow the widths I guess there is no quick way to identify these things. I was going through removing each width declaration to see if any of them were causing issues
~MARSMAN~
~MARSMAN~•15h ago
Yeah, sometimes you gonna have to find the culprit the hard way 🙈 But I always blame the images first lol, because they're the ones I mainly set width for them.

Did you find this page helpful?