Is there a way to make text resize automatically based on the height and width of its container? I've looked at similar questions but none seem to provide the right solution for me. I tried using fitText, but it doesn't take the container's height into consideration, causing the text to overflow at a certain point. Here is an example of my code:
<div class="col-sm-6 ms-3 mt-2 video-text-box bg-primary" style="height: 33vh">
<h4 class="desc-heading">
We offer a broad range of benefits.
</h4>
<p class="desc-text">
You can <span class="fw-bold">customize</span> a benefits program that's perfect for your needs.
</p>
<p class="desc-text">
Failure to enroll will result in you and your family losing benefit coverage starting January 1, 2023.
</p>
</div>
fitText Implementation:
jQuery(".desc-heading").fitText(1);
jQuery(".desc-text").fitText(1.3);
Note: Increasing the compressor value too much will make the text very small on tablet screens.