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
4 Replies
I'm using outline to see visually the overflowing boxes but hitting a wall with identifying what is causing overflow
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.
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
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.