How to implement scrolling of content in a block with fixed positioning without scrollbar?

Hello. Prompt, please, the decision with scrolling content in a block with fixed positioning. I found a solution, but the unit is embedded scrollbar, which looks sloppy. Is there a way in CSS to make a beautiful scrolling within a fixed block?
June 10th 19 at 15:35
3 answers
June 10th 19 at 15:37
Ask the unit fixed overflow:hidden and wrap content in div {height: 100%; overflow: auto} But that scrollbar hidden, it is necessary to "stretch" to the width you want. You can go another div to push with a width equal to the width of the fixed block and to push the content there, or ask ::before or ::after that wide
June 10th 19 at 15:39
June 10th 19 at 15:41
Parent block overflow:hidden, the indoor unit onto 17px wider, and overflow-y: scroll;
https://jsfiddle.net/300vzLey/show/
The idea is good, but not cross-browser, older browsers don't support the vh unit - Sam_Reynolds commented on June 10th 19 at 15:44
, omg! replace vh to px, em, what you want. They are there only to specify the coordinates of the fixed block and the font size. - Austen.Thompson53 commented on June 10th 19 at 15:47
well, and if you have a fixed div, not in body , but nested in another div. By the way, in this solution you only use CSS? - Sam_Reynolds commented on June 10th 19 at 15:50
Yes , this is without scripts.

Top right is a link "edit" where all the sources, to edit, press ctrl+enter and watch what happens.

An example of a simpler: https://jsfiddle.net/300vzLey/1/ - Austen.Thompson53 commented on June 10th 19 at 15:53

Find more questions by tags CSS