.hide-scroll { overflow: hidden;} .viewport { overflow: auto; /* Make sure the inner div is not larger than the container * so that we have room to scroll. */ max-height: 100%; /* Pick an arbitrary margin/padding that should be bigger * than the max width of all the scroll bars across * the devices you are targeting. * padding = -margin */ margin-right: -100px; padding-right: 100px;}
To disable vertical scroll bar just add : overflow-y:hidden;
Cross Browser Approach to hiding the scrollbar.
Css Code
/* make parent invisible */ #parent { visibility: hidden; overflow: scroll;} /* safari and chrome specific style, don't need to make parent invisible because we can style webkit scrollbars */ #parent:not(*:root) { visibility: visible;} /* make safari and chrome scrollbar invisible */ #parent::-webkit-scrollbar { visibility: hidden;} /* make the child visible */ #child { visibility: visible;}
Wikitechy Founder, Author, International Speaker, and Job Consultant. My role as the CEO of Wikitechy, I help businesses build their next generation digital platforms and help with their product innovation and growth strategy. I'm a frequent speaker at tech conferences and events.