69
loading...
This website collects cookies to deliver better user experience
::first-line
can be used to change the font of the first line of a paragraph) and also -webkit
browser prefix.width
and height
for the horizontal ones needs to be specified.::-webkit-scrollbar {
width: 1rem;
/*height: 1rem;*/
}
::-webkit-scrollbar-track {
background: #ffffff;
}
linear-gradient()
property.::-webkit-scrollbar-thumb {
background: linear-gradient(#FF5403,#EF2F88);
}
::-webkit-scrollbar-thumb
can be used to implement other pseudo-elements or selectors. One good example will be to decrease/increase the opacity on mouse hovering.::-webkit-scrollbar-thumb {
background: linear-gradient(#FF5403,#EF2F88);
border-radius: 100vw;
border: 0.20rem solid #ffffff;
}
margin-block
property.::-webkit-scrollbar-track {
background: #ffffff;
border-radius: 100vw;
margin-block: 0.5rem;
}
::webkit-scrollbar
will change the appearance for both of them. But what if you want only to focus on the vertical bar, the way to do that is by targeting the body
of the webpage.body::-webkit-scrollbar-track {
background: #ffffff;
border-radius: 100vw;
margin-block: 0.5rem;
}
vertical-scroll
to keep the body scrollbar at default and apply changes to all the horizontal ones.vertical-scroll::-webkit-scrollbar-track {
background: #ffffff;
border-radius: 100vw;
margin-block: 0.5rem;
}
overflow
property. It’s recommended to use the auto
keyword as it will only show the scrollbar if the content exceeds its container.