0

My question is fairly simple. I have a couple of div elements which their size will change with certain events. All those elements have data which is a string of two or three words.

I 'd like the text to be in it's maximum size but not overflow the element after resizing.

I did the math with javascript but since there are lots of rules to consider it got so complicated. Is there any way that CSS could handle this for me automaticaly?

Amir Shahbabaie
  • 1,352
  • 2
  • 14
  • 33

1 Answers1

2

I've had a similar issue and found a useful answer here: Font scaling based on width of container

Specifically the use of viewport height and width in css.