Last active
February 24, 2022 10:15
-
-
Save LucaRosaldi/a4bc1c63344286957c9e1f50d1345cef to your computer and use it in GitHub Desktop.
JS: Paste in console to show elements which overflow the viewport horizontally.
This file contains 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
/* Paste this snippet in the console */ | |
var docWidth = document.documentElement.offsetWidth; | |
[].forEach.call( | |
document.querySelectorAll('*'), | |
function(el) { | |
if (el.offsetWidth > docWidth) { | |
console.log(el); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great