Sungho Yahng
Sungho Yahng

Reputation: 91

How can I make the scrollbar transparent?

What I want is that the scroll is overlaid and transparent, so the elements behind it are shown through.

enter image description here

And This is what I want the scrollbar to look like.

enter image description here

Transparent scrollbar with css

I tried all of the code in the above question, but it failed.

My current css is this.

::-webkit-scrollbar {
width: 10px;
background: transparent url('../../assets/transparentPNG.png') repeat !important;
}
::-webkit-scrollbar-track {
background: transparent url('../../assets/transparentPNG.png') repeat !important;
} 

::-webkit-scrollbar-track-piece:start {
    background: transparent url('../../assets/transparentPNG.png') repeat !important;
}
::-webkit-scrollbar-track-piece:end {
    background: transparent url('../../assets/transparentPNG.png') repeat !important;
}

::-webkit-scrollbar-thumb {
background-color: rgba(67, 62, 78, 0.1);
opacity: 0.1;
}

::-webkit-scrollbar-button {
display: none;
}

::-webkit-scrollbar-corner {
display: none;
}

Upvotes: 0

Views: 3376

Answers (2)

Ricky
Ricky

Reputation: 498

Try using this it works for me .

 ::-webkit-scrollbar {
        display: none;
    }

Upvotes: 1

Dave
Dave

Reputation: 53

If you just want to hide the scrollbar, here's an easy fix:

HTML:

<div>
  ...Lots of text
</div>

CSS:

div::-webkit-scrollbar { width: 0 }
div {
  overflow: -moz-scrollbars-none; /* Firefox */
  -ms-overflow-style: none; /* IE */
}

Upvotes: 1

Related Questions