r/csshelp 16d ago

autosizing font with css only

hello everybody,

ive got a <div class="container"><pre>some random text</pre></div> block thats filled with random text. i kinda want that random text to fit the size of its container without using javascript. how to do something like that in css?

that random text can have multiple lines and i have no clue how to fit it all into a container whichs overflow is hidden.

greetings and thx for helping me out

1 Upvotes

1

u/SlickHando 13d ago

I am pretty sure that flex-wrap will give you the desired effect on your text.