且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

动态调整字体大小以适应容器大小

更新时间:2022-12-20 13:20:15

Basically, you need the next:

while( is_overflow_in_the_second_div() ) {
    set_smaller_font();
}

So, you should check questions with

  • how to detect scrolbars
  • how to detect overflow

and like, e.g.:

maybe many others.

Maybe you don't searched the questions for the right keyword, but this is probably an duplicate. :)