0

Consider a page with only a text "foo". I would like the text to take as much width as possible or 30% of the height. I don't want the text to be stretched and I don't want any js.

Setting font-size to 30vmin is not satisfying, since it doesn't care about the width.

If I assume a fixed aspect ratio, it is possible to do it with svg/viewport, but I would like to be able to use different texts, like "foo" and "foobar", without having to change anything.

This is manageable with images or svg shapes, but I can't do it with text.

Drup
  • 3,679
  • 13
  • 14
  • Unfortunately, there is no CSS property that will achieve this...Javascript will be required..and there are many plugins for that. – Paulie_D Jan 17 '16 at 00:50
  • Duplicate - http://stackoverflow.com/questions/6112660/how-to-automatically-change-the-text-size-inside-a-div?rq=1 – Paulie_D Jan 17 '16 at 00:52
  • Not a duplicate, he doesn't want to use js and the web has changed the past 3 years. – seahorsepip Jan 17 '16 at 02:11
  • 1
    @seahorsepip — Three years of advancement is a reason for new answers to be added to an existing question, not for a new question to be created. – Quentin Jan 17 '16 at 14:41
  • @Quentin good point, didn't think of that :) – seahorsepip Jan 17 '16 at 16:49

0 Answers0