Skip to content

Instantly share code, notes, and snippets.

@Anmol-Baranwal
Created June 4, 2023 08:55
Show Gist options
  • Save Anmol-Baranwal/3b3644e5bf5e8893f18637b2e05a37e7 to your computer and use it in GitHub Desktop.
Save Anmol-Baranwal/3b3644e5bf5e8893f18637b2e05a37e7 to your computer and use it in GitHub Desktop.
CSS Code for custom scrollbar ensuring browser cross-compatibility issues
/* Scrollbar /
/ Webkit-based browsers */
::-webkit-scrollbar {
width: 16px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: linear-gradient(#8034e4,#E638EAFF);
}
/* Firefox 64+ */
*{
scrollbar-width: thin;
scrollbar-color: #8034e4 #E638EAFF;
}
/* Firefox 63 and below */
*{
scrollbar-width: thin;
scrollbar-color: #8034e4 #E638EAFF;
}
/* Internet Explorer and Microsoft Edge */
*::-ms-scrollbar {
width: 16px;
}
*::-ms-scrollbar-track {
background: transparent;
}
*::-ms-scrollbar-thumb {
background: linear-gradient(#8034e4,#E638EAFF);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment