abuenog
07-25-2006, 12:00 PM
Hello,
I have a small problem with a div and I need some help. The question is:
I have two divs:
<div style="position: absolute; background-color: red">
<div style="position: relative; ">Test test test</div>
</div>
Where the background only is drawn where is the text. Now, I want to define a height in the div:
<div style="position: absolute; background-color: red; top:50">
<div style="position: relative; height:20px">Test test test</div>
</div>
But now the problem is in Internet explorer that the background is drawn with a 100% of width. If you see the two examples you will see what is the problem.
Is important to know that I can't define any with, because the text will be dynamic (can be different in different situations).
Any solution?
Thanks
I have a small problem with a div and I need some help. The question is:
I have two divs:
<div style="position: absolute; background-color: red">
<div style="position: relative; ">Test test test</div>
</div>
Where the background only is drawn where is the text. Now, I want to define a height in the div:
<div style="position: absolute; background-color: red; top:50">
<div style="position: relative; height:20px">Test test test</div>
</div>
But now the problem is in Internet explorer that the background is drawn with a 100% of width. If you see the two examples you will see what is the problem.
Is important to know that I can't define any with, because the text will be dynamic (can be different in different situations).
Any solution?
Thanks