Not really sure where you're going with this. But it seems you want to just have padding around the inner div?
<div style="background-color: yellow; width: 100px;
position: relative; padding: 8px">
<div style="background-color: gray;">Hello</div>
This way, the content of the inner div will alter the height of the outer div...