div {
border: 2px solid black;
margin-bottom: 2000px;
}
<!DOCTYPE html>
<html>
<body>
<div>
fsdfdfdfdvxvxcbxfvgxb
</div>
</body>
</html>
Inspect the height of the body element in the above snippet . It is equal to the content area i.e. the body height == div height
div {
border: 2px solid black;
margin-bottom: 2000px;
}
body {
border: 2px solid black;
}
<!DOCTYPE html>
<html>
<body>
<div>
fsdfdfdfdvxvxcbxfvgxb
</div>
</body>
</html>
In the above snippet . when we add border to the body element ,height of the body increases to 2000px .
My question is---- Why does this happens ??