It took me like 20 minutes to find this, so I'm asking and answering my question.
So, say I have a div:
<div id="foo"> Lorem ipsum dolor sit amet consecuter Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div>
And I'm not sure how much stuff is in the div. It could be one sentence or an entire scientific article.
So, if there's not much in the div, I want it to be just as wide as it needs to be. But, if there's a lot of stuff in the div, I want it to be, say, width: 75%
.
I.e., if it fits within 75% of your browser window, it's one line. If it doesn't fit, the lines wrap at 75%.
How do I do this?