Created
November 21, 2022 16:35
Find horizontal overflowing element in browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* add code below to Chrome inspector Console tab */ | |
var all = document.getElementsByTagName("*"), i = 0, rect, docWidth = document.documentElement.offsetWidth; | |
for (; i < all.length; i++) { | |
rect = all[i].getBoundingClientRect(); | |
if (rect.right > docWidth || rect.left < 0){ | |
console.log(all[i]); | |
all[i].style.borderTop = '1px solid red'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment