[英]how to make webkit scrollbar — visible
在我的HTML GUI中,它們是3部分:---
div
類scrollable
---&- div
ID為Images
) div
類為scrollableMenu
---&--- div
ID為menu
) 中心區域( div
類為scrollableCenter
---&--- div
ID為center)
目前,我只有webkit滾動條沿DIV scrollableMenu垂直向下運行。
多數民眾贊成在按照我的要求,即我只需要垂直向下運行的div scrollableMenu webkit滾動條。
我面臨的問題是,在第3和第4種情況下,我的Webkit滾動條變得不可見。
即使輸入類型圖像的數量較少,垂直向下運行的webkit-scrollbar-track是否仍然可以看到?
我必須添加哪個屬性以至少使我的webkit-scrollbar-track可見?
=========================================================
Button-1 Button-2 Button-3 Button-4 Button-5
=========================================================
||
||
||
DIV ||
scrollableMenu ||
||
||
||
||
||
=========================================================
div.scrollable {
margin: 0;
padding: 0;
overflow: auto;
padding-left: 4px;
padding-top: 20px;
box-sizing:border-box;
}
div.scrollableMenu {
margin: 0;
padding: 0;
overflow: auto;
padding-left: 4px;
padding-top: 20px;
box-sizing:border-box;
}
div.scrollableCenter {
margin: 0;
padding: 0;
overflow: auto;
padding-left: 4px;
padding-top: 20px;
box-sizing:border-box;
}
#images {
background-color:#888686;
white-space:nowrap;
}
#Menu {
background-color:#292B3B;
position:absolute;
top:115px;
bottom:20px;
left:0;
width:250px;
}
#center {
background-color:#292B3B;
position:absolute;
top:115px;
left:250px;
right:0px;
bottom:20px;
}
::-webkit-scrollbar-track {
background-color: #DDDFED;
border-radius: 20px;
}
::-webkit-scrollbar {
background-color: #DDDFED;
width: 10px;
height: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 8px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
background-color: #CCC9DA;
}
我假設您希望左側div scrollableMenu上的滾動條可見。 請使用overflow: scroll;
使滾動條可見。
div.scrollableMenu {
margin: 0;
padding: 0;
overflow-y: scroll;
overflow-x: hidden;
padding-left: 4px;
padding-top: 20px;
box-sizing:border-box;
}
修改: overflow: scroll;
overflow-y:scroll; overflow-x:hidden;
overflow-y:scroll; overflow-x:hidden;
。
我想您只想看到垂直(y)滾動條。
不是水平(x)。
您需要做的就是定義滾動條的位置(x或y):
div.scrollableMenu {
margin: 0;
padding: 0;
overflow-y: scroll; /*(-y) here defines the direction of the scrollbar*/
padding-left: 4px;
padding-top: 20px;
box-sizing:border-box;
}
如果由於某種原因仍然顯示底部滾動條,請使用overflow-x: hidden
。
編輯 :
快速說明:
(y)=垂直
[x)=水平
overflow
屬性的更多信息
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.