Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS easy way to get width (no length) of text inside tage Reply To: easy way to get width (no length) of text inside tage

#266361
Paulie_D
Member

There isn’t one since, with most fonts, characters are not all the same width.

The only simple method is to use a monospace font, where all characters ARE the same width.

Then you can use the ch length.

https://codepen.io/Paulie-D/pen/mXOxzz