Looking for a solution to hide scroll bars in Microsoft Chrome, but only when there is no content to scroll? The current div and styles always show the horizontal and vertical scroll bars, even when the height exceeds the content.
<div style="background: purple; width: 250px; height: 150px; overflow: scroll">
This is another test. This is another test. This is another test. This is another test. This is another test. This is another test. This is another test. This is another test. This is another test. This is another test.This is another test. This is another test. This is another test. This is another test. This is another test.This is another test. This is another test. This is another test. This is another test. This is another test.This is another test. This is another test. This is another test. This is another test. This is another test.
</div>
The following code hides the scroll bar:
::webkit-scrollbar{
display:none
}
I want the scroll bars to be visible only if there is content to scroll through
Is there a way to specifically hide just the horizontal scroll bar?