I use jqueryui.com/resizable and my Question is, if it is possible that the minimum width of the <div id="yellow" class=" resizable">
can be set that innerHTML text will still be fit into the element.
Here is an example of my JSFiddle: https://jsfiddle.net/awse5gmf/
HTML:
<div id="yellow" class=" resizable">
WILL_NOT_LINE_BREAK will line break
</div>
CSS:
#yellow {
width: 400px;
height: 50px;
background: yellow;
}
As seen in this picture , I can resize the <div>
smaller than the length of the text WILL_NOT_LINE_BREAK
. I want that the minimum width of the <div>
is the width of that the <div>
can still contain the whole text, that means the min width should be the width of the longest word that cannot line break.