You can't do this properly without relying on Javascript.
If you want to use a CSS-only solution whether it is even close to possible depends on how the div
is being resized - if it's based on viewport then you can achieve this (albeit in a very hacky and work-intensive, difficult to maintain fashion) with CSS media queries like below, if it's done some other way you probably have to resort to JS for any solution.
div {
width: 50%;
font-size: 72px;
}
@media only screen and (max-width: 1023px) {
div {
font-size: 36px;
}
}
@media only screen and (max-width: 767px) {
div {
font-size: 20px;
}
}
And so on. Obviously this is an approximate/imperfect solution at best and that is assuming your div
is sized relative to the window (which makes @media
queries relevant). Otherwise you probably have to use JavaScript.
I recently stumbled across FitText which is a JS plugin that does exactly what you're asking. Another option is BigText. Both require jQuery.