There are at least 2000 questions about this but in my particular scenario nothing I've tried worked.
- My page consists of 2 nested divs (
external,contents) contentsis clickable and should cover 100% of the document- there's also a bunch of absolutely positioned divs inside
contents: those are draggable by a user and can be in any position.
If there are enough of these divs, scrollbar appears. And my contents is limited by the current browser window height, so when I start to scroll it's cut:
Here's a codepen: https://codepen.io/sergey-kritskiy/pen/qBbqQJv
I've tried...
- setting
min-heightof everything one by one and all together; - adding flex on everything; float like this, float like that;
- use
%,vh,vmax;
When the scrollbar is made by a bunch of 'normal' divs, min-height works fine, but with these absolute guys I'm not in luck. I probably miss something obvious and I'd appreciate solutions.
Update:
There was an answer from someone that suggested to add position: relative; overflow-y: auto to contents and it worked in my case! But the answer was removed before I was able to ask why exactly that worked.
