Hacker News new | ask | show | jobs
by powertower 5573 days ago
"body {min-height:101%;}" will work much better than "overflow-y: scroll".

Unlike the latter it's CSS2 (vs CSS3) and also works without bugs.

1 comments

In practice this isn't true. As it turns out, the browsers that don't support overflow-y (certain versions of IE) happen to display a vertical scrollbar by default anyway.

Adding 'min-height: 100%' to the body will actually add a few pixels of empty space which the user can scroll to (confusing and ugly); whereas "html { overflow-y: scroll; }" will insert a placeholder for the scrollbar, the scrollbar itself will be grayed out. This is much better behavior in my opinion.

Also "html { overflow-y: scroll; }" is self-describing (i.e. the real goal is to add a vertical scrollbar to the html, not make the minimum height of the body 101%).