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?
Asked
Active
Viewed 45 times
0
-
2You 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
-
1not 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