1

ANSWER: My answer to how to accomplish this was found here: Is it possible to adjust a font's vertical scaling using CSS?

I have a div which is 477 width x 171 height, I'm wondering if there's away I can force it to enter image description here

Using FitText.js on a completely random text "Please don't down vote :)" enter image description here

Adjust my text to fit in the width. However I would like to un proportionally make it fit. enter image description here

To summarize I want to make the text fit the size of a div both height and width. I realize it might be aesthetically un pleasing since the font is stretched un proportional but for this case I need it.

I've searched not his subject, the answers are very old, '11 and others didn't help for both height and width.

Edit: The question is for BOTH height and width. Other questions cover only width and proportionally adjusting the font. Second edit: As also stated above the answers from some of those are from '11 way outdated.

Edit: This covers only width: CSS : Is it possible to adapt font size to div width? This covers responsive text as in proportionally changing font size: Pure CSS to make font-size responsive based on dynamic amount of characters This suggest fittext js which I posted on here that I'm using and does proportional enlarge: HTML / CSS - adjust font-size to fill parent height and width This doesn't give helpful info, CSS: Scale font-size to fit parent block element height This covers responsive also.

The question is to adjust to a height and width of the div.
In example make the font in this case 477 width x 171 height.

I haven't been able to dig into it with code because I can't find anything that address doing both height and width.

FabricioG
  • 3,107
  • 6
  • 35
  • 74
  • You may want to have a look at this library. In the example of the homepage, the text scales and stretches as the div does: https://daybrush.com/moveable/ – David Jul 29 '19 at 19:27
  • Duplicate given only covers width. On the question I stated that it needs to be width and height. @Temani Afif – FabricioG Jul 29 '19 at 19:29
  • I am adding more duplicate, shortly you will see 5. As a side note, your question doesn't show any effort of code and can be considered as *too broad* or *asking for external tools* – Temani Afif Jul 29 '19 at 19:30
  • I addressed the five references you've given. None of them address this question of height and width @TemaniAfif Afif – FabricioG Jul 29 '19 at 22:25

0 Answers0