I'm using tumblr. And I use the following code to change the cursor for the main body and hover on links:
body, a { cursor:url("http://i.imgur.com/2qleX.jpg"), auto}
a:hover { cursor:url("http://i.imgur.com/IepP2.jpg"), auto}
But it doesn't seem to affect the scrollbar I have added to one of the containers, which is:
overflow-y: auto;
overflow-x: hidden;
The cursor simply changes back to the default browser cursor when I hover/click the scrollbar. How do I customize the cursor for the scrollbar???
In order to customize the scrollbar, you have to use ::-webkit-scrollbar property. You can specify the width of the scrollbar and also set the scrollbar track or path by setting the background property. Furthermore, you can also add some hover effect on ::-webkit-scrollbar-thumb .
You can simply use the CSS cursor property with the value pointer to change the cursor into a hand pointer while hover over any element and not just hyperlink. In the following example when you place the cursor over the list item, it will change into a hand pointer instead of the default text selection cursor.
As of 2020, 96% of internet users are running browsers that support CSS scrollbar styling. However, you will need to write two sets of CSS rules to cover Blink and WebKit and also Firefox browsers. In this tutorial, you will learn how to use CSS to customize scrollbars to support modern browsers.
The default cursor for a hyperlink is "pointer". To change it, you need to specify the cursor type for your <a> element with the CSS :hover selector.
This code will customize the scrollbar Here I'm adding a cursor image when we hover the scrollbar This example will only work in webkit browsers like Chrome, Safari and Opera but not in Firefox or Edge/IE. This is a non-standard way.
body::-webkit-scrollbar-thumb {
cursor:url("http://i.imgur.com/2qleX.jpg"), auto;
}
p {
/* force scrollbar */
height: 200vh;
}
<p></p>
and also you can customize the Scrollbar completely, Use this
body::-webkit-scrollbar {
/*it will edit the scrollbar area*/
}
body::-webkit-scrollbar-track {
/*it will edit the scrollbar path*/
}
body::-webkit-scrollbar-thumb {
/*it will edit the scrollbar thumb which we use to scroll*/
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With