Skip to content

Instantly share code, notes, and snippets.

@tarciozemel
Created August 25, 2022 17:56
Show Gist options
  • Save tarciozemel/1bb7e39fe03c44b3a82f66b1f62693f8 to your computer and use it in GitHub Desktop.
Save tarciozemel/1bb7e39fe03c44b3a82f66b1f62693f8 to your computer and use it in GitHub Desktop.
Log too-wide elements
const docWidth = document.documentElement.offsetWidth
document.querySelectorAll('*').forEach(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