Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
1.22/5 (2 votes)
I have use these CSS to hide scroll bar in my drop-down menus.

I have drop-down menu with ul and li tags. UL have CSS max-height-400px; and overflow-y : scroll;

This is working on Chrome Browser but not in Mozila.

Please help me ....

What I have tried:

.no-scroll::-webkit-scrollbar {display:none;} /* Safari */
.no-scroll::-moz-scrollbars {display:none;}
.no-scroll::-o-scrollbar {display:none;} /* opera */
.no-scroll::-google-ms-scrollbar {display:none;}
.no-scroll::-khtml-scrollbar {display:none;}
Posted
Updated 10-Dec-19 1:20am
Comments
Peter_in_2780 25-Apr-16 9:15am    
Have you tried -moz-scrollbars-none ? I found it here: https://developer.mozilla.org/en-US/docs/Web/CSS/Mozilla_Extensions
Member 12479831 25-Apr-16 9:16am    
Yes I was already try it ...
Richard Deeming 25-Apr-16 9:59am    
As far as I can see, -moz-scrollbars-none was removed some time ago. The recommended replacement is overflow:hidden.

Perhaps it would be better to ask for help with your real problem instead. If possible, create a JSFiddle[^] with the minimum markup and CSS required to reproduce the problem.
Member 14684564 10-Dec-19 7:33am    
Not Working Firefox

1 solution

To remove scroll bar you can set
overflow-y: hidden
and you can remove max-height

This will work in Mozilla also.

See example:
<html>
<body>
<style>
ul{width:50px; overflow-y: hidden}
</style>
<ul >
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
</body>
</html>
 
Share this answer
 
v2
Comments
Member 12479831 27-Apr-16 1:17am    
Thank u very much for solution but this is not work in my site. I also remove all the all CSS to do this but cannot get success.

This code is work better in Mozilla but when I apply this code to drop-down menu this code will not work ...

Is there any solution for this?
swapnilmj 27-Apr-16 14:05pm    
Can you send exact html and css parts used for it?
So that I can give required solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900