0

Is it possible to say how long the text will be just with the css? I've got a title of the div displayed, it is static, 26 characters, including spaces, 2rem font. I would like the div to have min-width set as the length of that text. Is it possible to say how long it is going to be?

Malvinka
  • 1,185
  • 1
  • 15
  • 36
  • 2
    You can use `min-width: fit-content;` which means it will never go below the size of the content. Hence, "calculating display length." – Kameron Jan 31 '22 at 19:03
  • 1
    not all fonts have the same size, there are also proportional sizes according to each character, etc., your question is really incomplete... – Mister Jojo Jan 31 '22 at 19:06
  • Possible duplicate - https://stackoverflow.com/questions/26973570/setting-a-max-character-length-in-css/26975271#26975271 – Paulie_D Jan 31 '22 at 19:12

0 Answers0