Is there a way to force the vertical scrollbar to show on Safari Lion. It only shows if you click the far right of a page. I have an element where I have overflow-y:auto but in Safari it doesn't show until you click the edge of the element.
Asked
Active
Viewed 3.4k times
2 Answers
45
Ok found this online at this site http://css-tricks.com/custom-scrollbars-in-webkit/ This will make it show up in 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);
}
Obviously you will need to change the properties to suite what you want.
Again this is for Safari as overflow-y: scroll;
does not force it to show.
If you want to assign this to a scrollbar on a specific element, you can add any css selector before:
.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);
}

Iulian Onofrei
- 9,188
- 10
- 67
- 113

Chapsterj
- 6,483
- 20
- 70
- 124
-
1here's a demo with a js sniffer if you need that option: http://jsfiddle.net/NzUTt/3/ – albert Jan 20 '12 at 20:29
-
10This is awesome. You should accept your own answer. Other readers, note: by inserting a standard css selector before the `::-webkit...`, you can assign these properties to any individual element. – XML Oct 02 '12 at 23:02
-3
Apply the overflow-y to the html element.
html {
overflow-y:scroll;
}

rebz
- 2,053
- 3
- 16
- 16
-
1I tried that but it didn't work for Safari. This works for all other brasiers but Safari in Lion hides the scroll bar until you click on the right edge of an element. – Chapsterj Jan 20 '12 at 19:49