Im trying to make a div fill out the correct amount, corresponding to the text within it. This is normal behaviour with divs, but when adding position:relative and absolute theres trouble.
<div style="position:relative;background-color:#CDCDCD;">
<div style="position:absolute;top:0px;left:0px;">sadasd</div>
</div>
Its simple, i just want the background color to fill as long as the text goes. Setting a width is not an option.
I’ve tried with width:auto and display:block but I cant get it to work.
1 Answer