Once again I have read many posts on this topic but none of the suggested solutions work. I now have my solution, however, do not know why it works and would appreciate some insight.
Below is the solution found all over SO: Hide scroll bar, but while still being able to scroll
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Testing</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
</head>
<body>
<div class="hidden-xs hidden-sm col-md-3" id="parent">
<div id="child">
Test text here
</div>
</div>
</body>
</html>
CSS
#parent {
padding: 0px;
border-width: 1px;
border-style: solid;
height: calc(100vh);
overflow: hidden;
}
#child {
width: 100%;
height: 100%;
overflow-y: scroll;
padding-right: 17px; /* Increase/decrease this value for cross-browser compatibility */
}
The above does not work for me as the scroll bar remains visible. However, I have found a property on the page for the parent element "box-sizing" that when changed to anything other than "border-box" the scrollbar disappears and scrolling works as expected.
According to the browser, this CSS comes from the bootstrap.Sass gem.
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
My two questions are: 1) Why is this the case? 2) How do I turn it off in my CSS file?