ACO
02-10-2005, 01:12 PM
Searching for a way to have a div which has a fixed width of 50px but grows wider if the content of the div is exceeding 50px.
<div style="width:50px;border:solid 1px red">
<nobr>long text long text long text long text long text</nobr>
</div>
This code works with IE, but not with Mozilla.
With Mozilla the text overflows the container, but the container itself retains 50px width.
I need that the div has the same width as the text in it.
<div style="width:50px;border:solid 1px red">
<nobr>long text long text long text long text long text</nobr>
</div>
This code works with IE, but not with Mozilla.
With Mozilla the text overflows the container, but the container itself retains 50px width.
I need that the div has the same width as the text in it.