1

I have the following code to style custom scrollbars, but when the scrollbar is not needed because the content is not very long, I would like to hide the scrollbar. Is this possible?

Here's the code I have so far...

.myscroll::-webkit-scrollbar {
    width: 15px;     
}

.myscroll::-webkit-scrollbar-track {
    border-radius: 3px;
    background-color:#D4D4D4;
}

.myscroll::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background-color:#0085bf ;
}

1 Answer 1

2

Assuming that the element is having class myscroll, you can try following css

    .myscroll{
        overflow:auto;
    }

It might solve your issue.

Sign up to request clarification or add additional context in comments.

2 Comments

This still shows a blank scrollbar when you hover over the element.
setting overflow:auto in .myscroll doesn't work for you?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.