Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
隐藏不在chrome上使用css的滚动条_Css_Google Chrome - Fatal编程技术网

隐藏不在chrome上使用css的滚动条

隐藏不在chrome上使用css的滚动条,css,google-chrome,Css,Google Chrome,我试图用css隐藏滚动条,但它在firefox上工作,但在Chrome上滚动条仍然存在 .tests-container{ @media (min-width: 1025px) { max-height: 600px; overflow-y: scroll; :-webkit-scrollbar{ display: none; } -ms-overflow-style: none;

我试图用css隐藏滚动条,但它在firefox上工作,但在Chrome上滚动条仍然存在

.tests-container{
    @media (min-width: 1025px) {
        max-height: 600px;
        overflow-y: scroll;
        :-webkit-scrollbar{
            display: none;
        }
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    
}

我在类中没有看到媒体查询,因此我将改为

@media (min-width: 1025px) {
  .tests-container {
      max-height: 600px;
      /* overflow-y: scroll; */

      -ms-overflow-style: none;  /* IE and Edge */
      scrollbar-width: none;  /* Firefox */
  }
  
  .tests-container::-webkit-scrollbar {
    display: none;
  }
}
我在这里举了个例子。它在我的笔记本电脑Chrome MacOS上运行良好