Hide Scrollbar from div with overflow: auto

Asked

Viewed 740 times

3

I have a div .content that groups all content of the site with the following css:

margin: 15px 12px;
background: #fff;
padding: 20px;
height: calc(100vh - 30px);
overflow: auto;

My body has a background: #222 Different, to simulate an edge. It’s 100% functional, but I want to remove that sidebar on the side of the main div. If I put a overflow: hidden; in my .content, Scroll some, along with the possibility to scroll the page. Any solution in jQuery or even in pure CSS (it works, too, outside of Chrome)?

  • https://css-tricks.com/custom-scrollbars-in-webkit/ ai if it gives a trick to disappear...

  • Does not work in Firefox.

  • hum... and this...v is helped:https://coderwall.com/p/4wa6ba/hide-browser-scroll-bars

1 answer

2


Stackoverflow in English answered a similar question, which I believe solves your problem: https://stackoverflow.com/a/20447620/6762369

.div {
    background-color: red;
    position: relative;
    height: 214px;
    overflow: hidden;
    width: 452px;
    margin: 0px auto;
}
#inner{
    width: 100%;
    overflow: auto;
    height: 100%;
    padding-right: 15px;
}

In this question they left an example in the fiddle: http://jsfiddle.net/sp95S/1/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.