vertical scroll off but scrolling allowed - html

I want that the scollbar is hidden but you can still scroll.
if I now do:
body{
overflow-y:hidden
}
the vertical scroll is hidden but you can't scroll.
my question: is there a way to hide the scrollbar but you can still scroll?

You can try to add padding-right:20px; and overflow-x:hidden; to the overflowing element, hiding the scrollbar. Not sure if it works on body though.

Related

overflow y is set visible but behaves like scroll

I have set overflow-y : visible but it acts like scroll. I need overflow-x: scroll;overflow-y: visible. How can I set them both? my table need horizontal scrollbar. I have a dropdown list. but dropdown list is floating inside the table it is not coming outwards. while dropdown is appearing vertical scroll bar also coming
I found that if we give overflow-y: visible; overflow-x: scroll; then it will not work both will act as overflow scroll.

How can I render vertical, but not horizontal, scroll?

I tried incorporating scroll to my overflowing div element in CSS
using the overflow property. But it is attaching both vertical and horizontal scrollbars. I only need vertical scroll. How can I accomplish this with the least lines of code and no javascript or frameworks? Thanks.
.div{
overflow: scroll;
}
overflow-x for horizontal scroll
overflow-y for vertical scroll
So...
.div { overflow-y: scroll; }
Read more at MDN:
overflow-y
overflow-x
overflow

Remove scroll bars on div in IE?

I have a div with the property:
overflow-y: scroll;
On IE11 (havent tested other versions of IE yet) the div has a vertical grey scroll bar. Is there a way to remove this? But still maintain the overflow scroll?
I searched SO for an answer but only could find one relating to the body scroll bars and not a div.
Use auto property
overflow-y: auto;
scroll will always add scrollbar whether content is overflown or not. Using auto will show the scrollbar only when content is overflown.
MDN Doc

HTML Fixed Width? (No scroll bar)

I want to have a set width for my page with no horizontal scroll bar. (And if my elements exceed the page width, they don't add width or a horizontal scroll bar to the page.)
Probably not the best user experience, but this is what you need to add to your CSS:
body {
overflow-x:hidden;
}

Scrollbar on demand in CSS (overflow property)

I am creating a <div> with a class someClass
.someClass {
overflow:scroll
/*other props*/
}
The problem is that the scrollbars are always visible even when the data is not overflowing. I want the scrollbars to be visible only when data actually overflows.
overflow:auto; should do it. You need to set a width (for horizontal scrolling) and height (vertical) for that to pop out scrollbars at the right time though.
Use overflow: auto;