Find element that is causing the showing of horizontal scrollbar in Google Chrome

Flo picture Flo · Jul 16, 2015 · Viewed 29.1k times · Source

When I size my Chrome window to 328 x 455 pixels I still see a horizontal scrollbar. How can I find out which element is causing this? I've been looking elements via the developer console, but can't find the element.

I then tried the script I found here, but nothing is logged. I tried it on element body, section1 and a bunch of others but don't know what else to do.

    $(function () {
        var f = $('body'); //document.getElementById("body");
        var contentHeight = f.scrollHeight;
        var declaredHeight = $(f).height();

        var contentWidth = f.scrollWidth;
        var declaredWidth = $(f).width();
        if (contentHeight > declaredHeight) {
            console.log("invalid height");
        }
        if (contentWidth > declaredWidth) {
            console.log("invalid width");
        }
    });

Answer

Luca picture Luca · Jul 16, 2015
.slide-content .scroller {
  width: 1024px;
}

"fastestest" way: added this in inspector:

* {
  border: 1px solid #f00 !important;
}

and the culprit appeared