This question already has answers here:
How can I disable a browser or element scrollbar, but still allow scrolling with wheel or arrow keys?
(7 answers)
Closed 10 years ago.
After using the code:
body{
overflow:hidden;
}
The scrollbar disappears from the right-hand side of the page but as a consequence, I can no longer scroll up or down the page unless I click the scroll wheel on the mouse and drag in the direction I wish to scroll. Any ideas on how to combat this?
the purpose of overflow: hidden; is not to hide the scroll bars - that is a consequence of what is really happening, that is - all the content that exceeds the "visible" area is clipped (hidden).
You are basically looking for something (hiding scrollbars) that is not the purpose of overflow: hidden;
Related
This question already has answers here:
Hide scroll bar, but while still being able to scroll
(42 answers)
Closed 7 years ago.
I'm using
overflow: scroll
on a menu
how do I hide the scrollbar and still be able to scroll?
You cant,thats the whole point of the overflow:scroll; There are ways of styling it but never heard of removing it.
This question already has answers here:
HTML/CSS hack to allow overflow-x: auto & overflow-y: visible? [duplicate]
(2 answers)
Closed 6 years ago.
I've got a content area with a subcontent that's floated right inside. I want the subcontent to overlap the right edge just a bit. I also want the content area to be as tall as the subcontent which experience tells me I need to use overflow:auto to clear the float.
BUT I can't use overflow auto if I want the subcontent overlapping the edge can I? So I set overflow-x and overflow-y separately. Overflow-x:visible to show the overlap, & overflow-y: audo. But this has unexpected results!
Here's an example. I thought the subcontent would be visible, but it's being chopped off:
http://jsbin.com/yigelepigi/2/edit?html,css,output
Is it possible to do what I want using overflow-x and y?
Take away the overflow-x and overflow-y and the subcontent does overlap the right edge of its parent div.
This question already has answers here:
Prevent BODY from scrolling when a modal is opened
(52 answers)
Closed 8 years ago.
I'm working on a popover with scrollable content (similar to Facebook's notification popover).
Currently when the popover has focus and the user scrolls its content scrolls and all is well until the bottom is reached and the parent begins scrolling (see example of problem on CodePen).
I am trying to prevent the parent from scrolling when the bottom of the child is reached and would like to do so with just CSS if possible!
If you set overflow: hidden in the body, that will prevent it from scrolling. Of course when you close the popup, you will want to remove this property.
To add to Sam's answer. Tell it what you want on the fly -- example;
<div class="hover-content"
onmouseover="document.body.style.overflow='hidden';"
onmouseout="document.body.style.overflow='auto';">
blah yay I'm fixed
</div>
Hope this helps, cheers
This question already has answers here:
CSS overflow-x: visible; and overflow-y: hidden; causing scrollbar issue
(9 answers)
Closed 6 years ago.
I have a 400px x 400px div that I want to scroll vertically. So I'm setting overflow-y: auto. But occasionally, I want the content inside the div to overflow-x:visible.
This doesn't work. I think it's because you can't set different overflow values if one of them is visible.
True?
Otherwise, is there a decent css/js fix for this? I noticed flow app appends a calculated, absolutely-position div to the body whenever a situation like this occurs: http://cl.ly/32392W0U2t1y2Q103X2d. Is this the best solution? And are there any plugins/tutorials to look at?
You can’t set different overflow values if one of them is visible; the CSS3 Box Model draft says this in section on overflow: “The computed values of ‘overflow-x’ and ‘overflow-y’ are the same as their specified values, except that some combinations with ‘visible’ are not possible: if one is specified as ‘visible’ and the other is ‘scroll’ or ‘auto’, then ‘visible’ is set to ‘auto’.”
Regarding workarounds, you would first need to decide what the desired behavior is. When you have a scroll bar on the right, how would overflow-x: visible work? Should the overflowing content continue on the right of the scroll bar somehow? This would be difficult to arrange. Or should the scroll bar move to the right?
Try adding white-space: nowrap;
This question already has answers here:
CSS customized scroll bar in div
(20 answers)
Closed 7 years ago.
In a div I gave overflow auto to have a scroll bar to display the content that exceeds the limit
My scroll bar appears in blue color that doesn't suit my layout how can i change the color
div#navigation{background:#efe9b9; overflow:auto}
This is the css i am using ... I want brown colored scrll bar
How to get it
(except in IE)You can't change Scrollbars with CSS only, check out the JScrollPane for a Cross browser compatible scrollbar changer.
You can in IE, but I think it's been deprecated (or removed in IE8).
You can also do it in Safari.
Be warned that it will affect usability negatively.