解決火狐瀏覽隱藏不了滾動條問題

2021-7-8    前端達人

解決火狐瀏覽隱藏不了滾動條問題

1.里層容器的width多17px,外層容器溢出隱藏,能兼容各個瀏覽器

1
2
3
4
5
6
7
8
9
10
11
.outContainer {
width:350px;
height:300px;
overflow: hidden;
}
.inContainer {
   height:300px;
   width: 367px;
   overflow-x:hidden;
   overflow-y:scroll;
}

2.設置 scrollbar-width: none,可兼容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.outContainer {
width:350px;
height:300px;
overflow: hidden;
}
.inContainer {
   height:300px;
   width: 350px;
   overflow-x:hidden;
   overflow-y:scroll;
   scrollbar-width: none; 
}
/* 使用偽類選擇器 ::-webkit-scrollbar ,兼容chrome和safari瀏覽器 */
.inContainer::-webkit-scrollbar{
    display: none;
}
/*兼容火狐*/
.inContainer {
   scrollbar-width: none;
}
/* 兼容IE10+ */
.inContainer {
    -ms-overflow-style: none;
}

html如下

1
2
3
4
5
6
7
8
9
<body>
    <div class="outContainer" >
        <div class="inContainer">
            <div class="inContent" ></div>
            <div class="inContent inContent2"></div>
            <div class="inContent" ></div>
        </div>
    </div>
</body>


藍藍設計建立了UI設計分享群,每天會分享國內外的一些優(yōu)秀設計,如果有興趣的話,可以進入一起成長學習,請掃碼藍小助,報下信息,藍小助會請您入群。歡迎您加入噢~~希望得到建議咨詢、商務合作,也請與我們聯系。

截屏2021-05-13 上午11.41.03.png


分享此文一切功德,皆悉回向給文章原作者及眾讀者.

免責聲明:藍藍設計尊重原作者,文章的版權歸原作者。如涉及版權問題,請及時與我們取得聯系,我們立即更正或刪除。

藍藍設計www.yvirxh.cn )是一家專注而深入的界面設計公司,為期望卓越的國內外企業(yè)提供卓越的UI界面設計、BS界面設計 、 cs界面設計 、 ipad界面設計 、 包裝設計 、 圖標定制 、 用戶體驗 、交互設計、 網站建設 、平面設計服務

日歷

鏈接

個人資料

藍藍設計的小編 http://www.yvirxh.cn

存檔