Asaf Nevo Asaf Nevo - 1 year ago 125
CSS Question

Css overflow-y: how to show only when needed

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 ?

Answer Source

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`?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download