const findOverflows = () => { const documentWidth = document.documentElement.offsetWidth; document.querySelectorAll('*').forEach(element => { const box = element.getBoundingClientRect(); if (box.left < 0 || box.right > documentWidth) { console.log(element); element.style.border = '1px solid red'; } }); }; // Execute findOverflows to find overflows on the page. findOverflows();
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter