skip to Main Content

I have two div one is sidebar & another one is Categories bar, i want to hide scroll bar from categories bar but.

I tried

#sidebar ::-webkit-scrollbar-thumb { visibility: hidden; }

but it hide scrollbar from both div. Please help.

2

Answers


  1. why don’t you use overflow?? like: #sidebar { overflow: hidden; }

    Login or Signup to reply.
  2. You could add a class to categories bar div. The class would target specific scrollbar you are trying to hide.

    Something like this, use as reference and adapt to your own code.

    <div id="sidebar">
      ...
    </div>
    
    <div class="categories-bar">
      ...
    </div>
    
    <style>
      #sidebar ::-webkit-scrollbar-thumb {
        visibility: visible;
      }
      
      .categories-bar ::-webkit-scrollbar-thumb {
        visibility: hidden;
      }
    </style>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search