1

I just remember that there was this very neat (new?) CSS expression to say "hey font, I want you to be exactly this size that you fit into this div container perfectly".

But I'm afraid, I don't remember this cool CSS expression. I'm pretty sure (and hope) that there is one. Can anyone help?

Simon Ferndriger
  • 4,455
  • 6
  • 28
  • 53
  • Not sure of that specific expression, but using em's is normally the best way to go from a Viewport perspective to ensure your font always sizes correctly/responsively. – dbrree Jun 29 '17 at 14:37
  • duplicate - https://stackoverflow.com/questions/16056591/font-scaling-based-on-width-of-container – Paulie_D Jun 29 '17 at 15:35
  • @Paulie_D No, it is not a duplicate. I don't want to scale the font size with the container just in general, I want it to *fit perfectly* from starting point to end point of the container. Always. An auto detection of font-size if you will, not a responsive readjustment of an existing font size. – Simon Ferndriger Jul 03 '17 at 11:09

1 Answers1

-1

I'm not aware of such an expression. But I can make some advertisement to my codepen ;) There you got the container, which is like 420px wide and jQuery calculates the font-size, to fit the container.

I'm on train right now on my mobile and can't write any detailed answer. Sorry for that

// some code, bc links to codepen have to be accompanied by code
Tobias Glaus
  • 3,008
  • 3
  • 18
  • 37
  • may i ask what the reason was to downvote this? it's a solution to his question. isn't that, what stackoverflow is about? – Tobias Glaus Jun 29 '17 at 20:13
  • I couldn't say other than answers should have the actual code in them **not links to external sites**. You **actively** circumvented the requirement by adding *non-code* in a **delberate** manner. – Paulie_D Jul 03 '17 at 11:21