I'm adding the overflow-y parameter to "scroll" in my css in order to have scrolling bar in case of overflow..
My problem is that if the content is not overflowing - i'm still having the blank scroll bar.
How can i set the overflow to show the scrolling bar only when needed ?
You can set it to auto
overflow-y : auto;
It will only show scroll bar in case of overflow.
Refer : What browsers support `overflow-y`?
as mentioned before, the way to do this is by setting:
overflow-y: auto
When setting the property to auto, the browser determines how to handle the content, but generally, the scrollbar appears when it is required.
You would greatly benefit from learning more about the overflow property. There is a great article here that explains it nicely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With