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

后端 未结 5 1473
天命终不由人
天命终不由人 2020-12-22 22:46

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 de

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-22 23:09

    Adding a border to everything made the problem go away for me. The culprit was a drop-down menu hidden with opacity: 0. I actually found it by process of elimination - delete elements in the DevTools one by one, starting with parent elements and moving down the tree.

    This would have done it for me:

    * {
      opacity: 1 !important;
      visibility: visible !important;
    }
    

提交回复
热议问题