Reputation: 341
I am creating a responsive Players info page for a website using angularJS, and on the far left i am making a list of all other players in the database shown as picture icons where the user can click on any one to get their info page.
My Problem is that i want to make the list a specific height "the height of the users browser window or the width of the user screen on mobile mode", and to solve this i used "overflow: Auto" which did exactly that, but it also produced an ugly scroll bar "in the desktop mode or large window in general" which i want to get rid of, in the "small and xs" i don't mind the scroll bar but on "large" windows the scroll bar is ugly.
I tried making a css class where i place a padding which hide the scroll bar.
width: 100%;
overflow: auto;
height: 100%;
padding-right: 15px;
but it produced other bugs and its not perfect as on some windows the scrollbar size is different and it won't hide it all, also on mobile it removed the scroll bar which is not ideal.
I want to
Either option is good enough for me.
Upvotes: 0
Views: 1722
Reputation: 58
This should give you the momentum you need to do what you need to:
I snagged this code from W3Schools recently to do something similar and changed it to what's below.
Some media queries and changing the width to 0 might just do the trick of hiding the scrollbar. The rest of how it looks is all up to you.
/* width */
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
/* box-shadow: inset 0 0 5px grey; */
/* border-radius: 5px; */
}
/* Handle */
::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.25);
/* border-radius: 5px; */
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.5);
cursor: grab;
}
Upvotes: 2