查找导致在Google Chrome浏览器中显示水平滚动条的元素 [英] Find element that is causing the showing of horizontal scrollbar in Google Chrome

查看:326
本文介绍了查找导致在Google Chrome浏览器中显示水平滚动条的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将Chrome窗口的大小调整为328 x 455像素时,我仍然看到水平滚动条. 我如何找出造成此问题的因素?我一直在通过开发人员控制台查找元素,但是找不到该元素.

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.

然后,我尝试在此处,但未记录任何内容. 我在元素bodysection1和其他许多元素上进行了尝试,但是不知道该怎么做.

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");
        }
    });

推荐答案

.slide-content .scroller {
  width: 1024px;
}

最快"方式:在检查器中添加了此方法:

"fastestest" way: added this in inspector:

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

罪魁祸首出现

这篇关于查找导致在Google Chrome浏览器中显示水平滚动条的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆