+ 4
body {width: 100%; height: 100%;}
Why do people use the CSS code in cases when it does nothing but not very nice horizontal scrolling? Is it some tradition?
3 ответов
+ 4
Ginfio I thought that children elements may expand parent elements and resizing children is a better way than resizing parents. Of course to have a child fully expanded a parent the parent should have no padding.
+ 4
Ginfio also I heard that height: 100% works not very well.
+ 2
I think it’s to allow the children elements to be able to have 100% width / height.
<body>
<div> </div>
</body>
I think it’s like... in this code example above:
the div can’t have 100% height if the body doesn’t.