remove these parts:
html,body{height:100%;}
body{margin:4%;}
when making elements specific sizes, only use percentages when you're using "position: fixed" on the selected element.
set the margin in the element itself instead, also setting the element in percentages only works when you have a "position: fixed" on your element.