I have one div with predefined width (say 80px), but the length of the content in the div can be long, can any body tell me how to increase the width of div based on content length?
my div looks like
<div class="content">
Text here
</div>
I have tried to use jQuery to resize it, but I am always getting 0 value when I am using .width() or .innerWidth() functions.
Thanks
Ashwani
Sounds like overkill to me. If possible, just modify the CSS from your div to:
That should ensure the div still expands dynamically if neccessary.