2

I m trying to change the colour of the scrollbar of a div whenever I hover on the div.How could I do it ? Is there any way of doing it without giving the id of the div ? what I tried so far is ;

div:hover {

   ::-webkit-scrollbar{color:black}

}

and

div:hover + ::-webkit-scrollbar{

  color: black;  
}
tolquito
  • 91
  • 2
  • 10
  • possible duplicate of [Style webkit scrollbar on certain state](http://stackoverflow.com/questions/8632410/style-webkit-scrollbar-on-certain-state) – Inkbug Jul 23 '15 at 05:33

1 Answers1

2
div:hover::-webkit-scrollbar {
    background: black;
}
Sid Jain
  • 177
  • 1
  • 11