The div.test was initially set with a height of auto, meaning no fixed height.
.test {
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
background: yellow;
width: 200px;
height: auto;
padding: 10px;
}
<div class="test">
This is some test information for my div.
</div>
By adding position:absolute;
in the CSS, all other style attributes remain the same.
.test {
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
background: yellow;
width: 200px;
height: auto;
padding: 10px;
position: absolute;
}
<div class="test">
This is some test information for my div.
</div>
After adding the position property, the height of div.test appears to have increased. Why is this happening?