Created
November 15, 2020 22:57
-
-
Save marcus-grant/4ceec56b91c409df2ccfee1621b1fe4c to your computer and use it in GitHub Desktop.
JS snippet that when put in devtools console will find horizontally overflowing elements
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
| 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