有没有办法强制垂直滚动条显示在Safari Lion上.它仅显示您是否单击页面的最右侧.我有一个元素,我有溢出-y:auto但在Safari中它不会显示,直到你单击元素的边缘.
Cha*_*erj 40
好的在这个网站上找到了这个http://css-tricks.com/custom-scrollbars-in-webkit/ 这将使它出现在Safari Lion中
::-webkit-scrollbar {
-webkit-appearance: none;
width: 8px;
}
::-webkit-scrollbar-track {
background-color: rgba(57,57,57, .6);
border-radius: 8px;
}
::-webkit-scrollbar-thumb {
border-radius: 8px;
background-color: rgba(156, 156, 156, .6);
}
Run Code Online (Sandbox Code Playgroud)
显然,您需要更改属性以满足您的需求.这也适用于Safari,因为overflow-y: scroll;它不会强制显示.
如果要将其指定给特定元素的滚动条,可以在以下情况之前添加任何css选择器:
.mydiv::-webkit-scrollbar {
-webkit-appearance: none;
width: 8px;
}
.mydiv::-webkit-scrollbar-track {
background-color: rgba(57,57,57, .6);
border-radius: 8px;
}
.mydiv::-webkit-scrollbar-thumb {
border-radius: 8px;
background-color: rgba(156, 156, 156, .6);
}
Run Code Online (Sandbox Code Playgroud)