XHTML HTML element with 100% height causing scrollbars

后端 未结 6 1132
渐次进展
渐次进展 2021-01-17 10:29

In my CSS file I use this:

html,body{height:100%;padding:0;margin:0;border:0;}

Which causes a vertical scrollbar to appear on IE8, Chrome 5

6条回答
  •  半阙折子戏
    2021-01-17 11:00

    There may be better ways but I simply default to 98% which seems to obviate scrollbars in all browsers.

    you could also set the height using JavaScript but that feels a little hacky

提交回复
热议问题