Setting global variables in html or body

I have some questions regarding the following css I found:

html, body {
    height:100%;
    min-width:100%;
    position:absolute;
}

html {
    background: none repeat scroll 0 0 #fff;
    color:#fff;
    font-family:arial,helvetica,sans-serif;
    font-size:15px;
}


  • Do I need to have a height and a minimum width of up to 100% on html and body? What is the use?
  • What is the reason for using an absolute position?
  • Why did they set the background / color / font to html and not to the body? Is there any difference? Or is it just a preference?


+5
source share
2 answers
  • . , . , , /- css , ( , , ? ). , . , Div A width: 100%, width: 500px Div A 100% 500px.

  • position: absolute html +, . , nolonger " " ( , / ).

    , position: relative . , A () B (), B left: 10px;, B , , A . , .

    "position: absolute" , . , ( " " ).

  • , , .

+4

100% , 100% . , html, - , 100% , .

: http://jsfiddle.net/KZaum/

+2

All Articles