I have a span inside of a div and the div must remain 200px wide and the text must fit on one line within the div. The text within the span is dynamically generated so I can't possibly know which content will break to a new line and which will not.
<div style="width:200px">
<span style="font-size:12px;">This sentence is too large to fit within the div.</span>
</div>
If I use the CSS property white-space:nowrap;
the words will spill to the outside of the div, which of course, we don't want.
How would I reduce the font-size (or zoom) based on if the line breaks or not? I would prefer a CSS answer, but I understand if that is outside of CSS's abilities.