Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrollbar not scrolling completely down the page

Tags:

html

css

I have this minor issue. I have a main div with class scroll. I have several other input parameters where I take input from the user. This inputs fills up the entire page vertically.

Now I minimize the screen with Chrome minimize button. (i.e. restore down button). The page gets shrinked and a scrollbar shows up since it is set to overflow:scroll.

Now the problem is that it does not scroll till the end of the page. suppose there are 20 input parameters and when I minimize, I can scroll up to 18th input parameter only. Scrollbar doesn't go beyond 18 and hides the last 2 so the viewer is not able to see.

<div class="scroll">
</div>
<!-- Added this extra div below and now able to scroll the last 2 parameters as well -->
<div style="height:50px;">
</div>

.scroll {
height:100%;
overflow:scroll; 
}

Can someone please let me know if I did anything wrong.

like image 433
Patrick Avatar asked May 17 '16 22:05

Patrick


People also ask

Why is my page not scrolling?

Your website might not be scrolling if there is a problem with your browser (Google Chrome, Safari, etc.), website code, or your computer hardware. You can investigate & fix the issue by restarting the browser, looking at the site code, deleting cookies, extensions, and/or caches.

How do I fix scroll bar problems?

Sometimes, when it comes to random software errors, restarting the affected program, which is the Chrome browser in your case, fixes the issue. Simply exit Chrome and then relaunch it. If this doesn't work, exit Chrome, reboot Windows and then restart Chrome. Check to see if the scroll bar reappears.

How do I change scroll bar settings?

Double-click/tap on ScrollHeight. The Edit String window will open with the default value of -255. That is the standard size of the scrollbars you see on Windows. To change the Scrollbars height to your liking, enter a value between -120 (smaller) to -1500 (larger) for the size you want, and click/tap on OK.


2 Answers

possible causes:

  • A vertical offset like margin-top: 100px or top: 100px combined with height: 100% when using position: absolute;. In this case change to height: calc(100% - 100px);

  • The same with padding-top or padding-bottom. Possible solution: box-sizing: border-box;

But without code all this is guessing...

like image 142
Johannes Avatar answered Oct 12 '22 23:10

Johannes


.scroll{
height: calc(100vh - 100%);
overflow-y: scroll;
}
like image 36
karthickkannan Avatar answered Oct 13 '22 01:10

karthickkannan