css formating issue with html at top -


so i'm trying design webpage , trying footer stick bottom of page @ times. did manage trouble figured out error was. want know difference between doing this,

body {     background: red;     margin:0;     padding:0;     height:100%; } #wrapper {     min-height:100%;     position:relative; } #header {     background: black;     padding:10px; } #content {     background: green;     padding-bottom:100px; /* height of footer element */ } #footer {     background:#ffab62;     width:100%;     height:100px;     position:absolute;     bottom:0;     left:0; } 

and doing this,

html, body {     background: red;     margin:0;     padding:0;     height:100%; } #wrapper {     min-height:100%;     position:relative; } #header {     background: black;     padding:10px; } #content {     background: green;     padding-bottom:100px; /* height of footer element */ } #footer {     background:#ffab62;     width:100%;     height:100px;     position:absolute;     bottom:0;     left:0; } 

why putting html part @ top make footer part of code work? doesn't seem effect of other code, part makes footer stay @ bottom. isn't code code got here have same issue in code though , wondering deal cause can't find on this.

http://www.cssreset.com/2010/css-tutorials/how-to-keep-footer-at-bottom-of-page-with-css/

sorry if wrote wrong first time posting.

body looks parent (html) how scale dynamic property, html element needs have it's height set well.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -